The code you posted, is similarly at the mercy of the underlying signaling mechanism.
My code doesn't hang in its posted form anywhere.
And add long running code into the processing loops of any or all of the threads and all threads will always be able to make forward progress.
My code works! As posted, and during evolution to realistic scenarios. By design!
In reply to Re^14: Threads sharing global variable
by BrowserUk
in thread Threads sharing global variable
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |