Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

MCThreadData Class Reference

Provides a definition of thread private data. More...

#include <mcllib/MCThreadData.h>

Inheritance diagram for MCThreadData:

MCRefCount List of all members.

Public Member Functions

virtual void attach ()
 Called when attaching to a thread.
virtual void detach ()
 Called when detaching from a thread.
 MCThreadData ()
 Construct a thread data.
virtual ~MCThreadData ()
 Destruct a thread data - perform any required cleanup This is called when there are no more references to the MCThreadData.

Detailed Description

Provides a definition of thread private data.

Only objects of classes derived from this class can be used as thread private data. Instances may be added to a thread by a call to MCThread::setData() or to the current thread and all future threads by a call to MCThread::setDataAll() Generally, a particular instance is set on only one thread so different threads have different instances. However, it is possible to call MCThread::setData() with the same ThreadData object for multiple threads.

See also:
MCThreadSingleton


Member Function Documentation

virtual void attach  )  [virtual]
 

Called when attaching to a thread.

If the thread data is registered for all threads then attach is called before the MCRunnable::run() method is called for a thread.

virtual void detach  )  [virtual]
 

Called when detaching from a thread.

detach() is called when the thread exits or a new thread data is set for a particular index. In both cases it is called per thread on which the thread data is registered. Consequently, it may be called multiple times if the thread data has been set on more than one thread (or has been used in a MCThread::setDataAll() call).


Generated on Wed Jan 12 19:05:50 2005 for MCLLIB by  doxygen 1.3.9.1