Run Code
|
API
|
Code Wall
|
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
Rextester.Program.Main
ObjectPool
3
STAN
Fibonacci Series
Lp2
How to find the first index of a sub-string in a given string?
单链表
1stoccuinsorted
fq