in reply to Re^4: Threads sharing global variable
in thread Threads sharing global variable
update:
FWIW, if I only move the lock in set_positive inside the while loop, still just one line of output.
If I only move the lock in set_zero inside the while loop, a couple thousand lines of output, and then it locks hangs
If I move both the lock statements inside the while loop, like BrowserUk wrote, it just keeps running and doesn't hang
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Threads sharing global variable
by ikegami (Patriarch) on Mar 09, 2016 at 13:40 UTC | |
by BrowserUk (Patriarch) on Mar 09, 2016 at 14:58 UTC | |
by ikegami (Patriarch) on Mar 09, 2016 at 17:36 UTC | |
by BrowserUk (Patriarch) on Mar 09, 2016 at 17:49 UTC | |
by ikegami (Patriarch) on Mar 09, 2016 at 17:53 UTC | |
| |
by Anonymous Monk on Mar 10, 2016 at 05:03 UTC | |
|