Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members  

RazorBack::MTmgrjoin_ Class Reference

Class MTmgrjoin_: manages joinable threads. More...

#include <MTmgr.hh>

Inheritance diagram for RazorBack::MTmgrjoin_:

Inheritance graph
[legend]
Collaboration diagram for RazorBack::MTmgrjoin_:

Collaboration graph
[legend]
List of all members.

Public Methods

 MTmgrjoin_ ()
 default ctor.

virtual ~MTmgrjoin_ ()
 dtor: reap all threads still running.

virtual size_t launch (size_t Threadno, Threadstartfn_ Startfn, void *Arg)
 launch(Threadno, Startfn, Arg): launches Threadno joinable threads. More...

virtual void reap ()
 reap(): reaps all threads launched by the calling object. More...

virtual void reap (pthread_t ID)
 reap(ID): performs a join operation on thread ID (waits on it if necessary). More...


Private Methods

 MTmgrjoin_ (const MTmgrjoin_ &)
MTmgrjoin_& operator= (const MTmgrjoin_ &)

Detailed Description

Class MTmgrjoin_: manages joinable threads.

Most useful in situation where the original thread just has to launch a few "working" threads and then collects them before the program exits.

Definition at line 135 of file MTmgr.hh.


Constructor & Destructor Documentation

RazorBack::MTmgrjoin_::MTmgrjoin_ ( ) [inline]
 

default ctor.

Definition at line 141 of file MTmgr.hh.

RazorBack::MTmgrjoin_::~MTmgrjoin_ ( ) [inline, virtual]
 

dtor: reap all threads still running.

Definition at line 144 of file MTmgr.hh.

RazorBack::MTmgrjoin_::MTmgrjoin_ ( const MTmgrjoin_ & ) [private]
 


Member Function Documentation

size_t RazorBack::MTmgrjoin_::launch ( size_t Threadno,
Threadstartfn_ Startfn,
void * Arg ) [virtual]
 

launch(Threadno, Startfn, Arg): launches Threadno joinable threads.

These start execution in the global C function pointed to by Startfn, with argument Arg. The threads will have default attributes. Returns the number of threads actually launched.

Reimplemented from RazorBack::MTmgrbase_.

void RazorBack::MTmgrjoin_::reap ( ) [virtual]
 

reap(): reaps all threads launched by the calling object.

This happens by performing a pthread_join() on all thread IDs that are in the internal list of the calling object, i.e. invocation of this method means that the invoking thread must wait until all threads are reaped.

Reimplemented from RazorBack::MTmgrbase_.

Referenced by ~MTmgrjoin_().

void RazorBack::MTmgrjoin_::reap ( pthread_t ID ) [virtual]
 

reap(ID): performs a join operation on thread ID (waits on it if necessary).

Does nothing if the thread ID is invalid.

Reimplemented from RazorBack::MTmgrbase_.

MTmgrjoin_& RazorBack::MTmgrjoin_::operator= ( const MTmgrjoin_ & ) [private]
 


The documentation for this class was generated from the following file:
Generated at Wed Aug 21 09:33:35 2002 for The Razorback C++ Library: POSIX Thread Wrappers by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001