Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Volatile madness
//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.Linq; using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; namespace Rextester { public class Program { # Дорогой фриман, убери слово volatile и поведение проги изменится, вот увидишь private volatile bool flag = true; private void run() { Task.Factory.StartNew(resetFlagAfter1s); int x = 0; while (flag)++x; Console.WriteLine("Done"); } private void resetFlagAfter1s() { Thread.Sleep(1000); flag = false; } public static void Main(String[] a) { new Program().run(); } } }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
Exception Handling
Program
Reverse linked list iterative method
a
Generics Base class constraints Doubts
JagArray
Get days from two dates
1 to 1000 armstrong
Sum Matrix Column
sdfrgyhjuiku7y6t5rf
Please log in to post a comment.