Use of Condition Variables
BlitzMax Forums/BlitzMax Programming/Use of Condition Variables
| ||
In this post by Brucey he talked about use of Condition Variables for threading, seemingly that you need to use it when you're inside a mutex lock so that it will temporarily unlock until a signal is sent.. http://www.blitzbasic.com/Community/posts.php?topic=80344#904757 But is it possible to just use WaitCondVar() without there necessarily being inside a mutex lock? ie what I want to do is basically just put a thread on `pause` and await some kind of signal to have it resume execution. |
| ||
Or maybe I need to use a semaphore, put the thread on hold and then PostSemaphore() to trigger it? |
| ||
I think I figured this out by using a separate semaphore for each thread, WaitSemaphore() to stop the thread executing, and then PostSemaphore() to increment its counter, causing the thread to resume. |