Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
thread kill
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Threading.Tasks; using System.Threading; namespace Rextester { public class Program { public static void Main(string[] args) { ThreadingClass th = new ThreadingClass(); Thread thread1 = new Thread(th.DoStuff); thread1.Start(); Console.WriteLine("Press any key to exit!!!"); Console.ReadKey(); th.Stop(); thread1.Join(); } } public class ThreadingClass { private bool flag = false; public void DoStuff() { while (!flag) { Console.WriteLine(" Thread is Still Working"); Thread.Sleep(1000); } } public void Stop() { flag = true; } } }
run
|
edit
|
history
|
help
1
a6
Fibonacci Recursive C#
1stoccuinsorted
math 5.74
1
HelloWorld
hola1
Testing 003
Pet Name Generator
Q-2 dotnet