Class thread_group
boost::thread_group —
The thread_group class provides a container
for easy grouping of threads to simplify several common thread
creation and management idioms.
Synopsis
Description
thread_group
construct/copy/destruct
-
thread_group();
-
~thread_group();
Effects: |
Destroys each contained thread object. Destroys *this . |
Notes: |
Behavior is undefined if another thread references
*this during the execution of the destructor.
|
thread_group
modifier
-
thread* create_thread(const boost::function0<void>& threadfunc);
Effects: |
Creates a new thread object
that executes threadfunc and adds it to the
thread_group container object's list of managed
thread objects. |
Returns: |
Pointer to the newly created
thread object. |
-
void add_thread(thread* thrd);
Effects: |
Adds thrd to the
thread_group object's list of managed
thread objects. The thrd
object must have been allocated via operator new and will
be deleted when the group is destroyed. |
-
void remove_thread(thread* thrd);
Effects: |
Removes thread from *this 's
list of managed thread objects. |
Throws: |
??? if
thrd is not in *this 's list
of managed thread objects. |
-
void join_all();
Effects: |
Calls join() on each of the managed
thread objects. |