BSignalThread Class Reference
[Utility]

#include <BThread.h>

Inheritance diagram for BSignalThread:

Inheritance graph
[legend]
Collaboration diagram for BSignalThread:

Collaboration graph
[legend]
List of all members.

Detailed Description

A base class for classes that are executing their own Boost thread, with some signaling capability.

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


The documentation for this class was generated from the following file:
Generated on Tue Mar 6 17:57:17 2007 for AME Repository by  doxygen 1.5.1-p1