|
tech
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Spot the Bug: Fun Concurrency Bugminutes to figure out what the root cause was, and it left me thinking, "Wow. That was an interesting one that doesn't come up very often!". So, for fun, who sees the bug and can explain why it's happening? List<Thread> threads = new List<Thread>(); for (int i = 0; i < 2; i++) { Thread t = new Thread(delegate() { Debug.Assert(i != 2); }); t.Start(); threads.Add(t); } foreach (Thread thread in threads) thread.Join(); -- Chris Mullins |
|||||||||||||||||||||||