#include <BThread.h>
Inheritance diagram for BSignalThread:


It adds a signal(condition) to the BThread class, with the intended semantics of allowing the thread to suspend, and then resume it via the signal. The derived function should implement the void ThreadFunction() function with the code that should be executed in the thread.
In the following example, the main thread is synchronizing with the worker thread via the thread's signal:
Public Member Functions | |
| void | WaitUntilSuspended () |
| Waits until the thread is suspended. | |
| void | WaitAndSignal () |
| Waits for the thread to be suspended, then signals it. | |
| bool | Waiting () |
| Returns true if the tread is suspended. | |
| void | Join () |
| Joins the thread (i.e., this function will not return until the thread finishes). | |
| void | Start () |
| Activates the thread. | |
Protected Member Functions | |
| BSignalThread () | |
| Default constructor. Does not start the thread. | |
| void | Suspend (boost::mutex::scoped_lock &lock) |
| Suspends the thread until a signal is received. | |
| virtual void | ThreadFunction ()=0 |
| This function is executed in the new thread when it is started. | |
| bool | Terminating () |
| Returns true if the thread is being joined (the thread should finish). | |
Protected Attributes | |
| boost::mutex | mutex_ |
| Class mutex. | |
| volatile bool | terminating |
1.5.1-p1