Quantcast
Channel: dotnetomaniak.pl - Artykuły z tagiem threading
Viewing all articles
Browse latest Browse all 10

Piotr Zieliński » Code Review: Thread.Suspend

0
0
Każdy wątek posiada metodę Suspend, która wstrzymuje jego wykonywanie. Ktoś mógłby napisać  takiego “potworka”:class Program { staticvoid Main(string[] args) { Thread thread=new Thread(Run); thread.Start(); Thread.Sleep(1000); thread.Suspend(); Thread.Sleep(5000); thread.Resume(); } staticprivatevoid Run() { while(true) { Console.WriteLine("Running..."); } } } Używanie Suspend jest bardzo złą praktyką i może ...
Podbij ↑

Viewing all articles
Browse latest Browse all 10

Latest Images

Trending Articles