I'm looking at some very old code from .net 3.5 which has a bunch of .Abort() calls like this:
if (someThread.IsAlive == true){ someThread.Abort();}someThread = new Thread(() => SomeFunction(cancellationToken));someThread.IsBackground = ture;
if (someThread.IsAlive == true){ someThread.Abort();}someThread = new Thread(() => SomeFunction(cancellationToken));someThread.IsBackground = ture;
Would it make sense to just switch these to tasks or is there a different replacement I can make? The most likely scenario is that these run for a long time (possibly days) if that matters.
Recent Announcements
Continue the conversation
Join the Discord to ask follow-up questions and connect with the community
C
C#
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.