rpa::thread_fast_t< Thr, Mtx > Class Template Reference

#include <thread_fast.h>

List of all members.

Public Member Functions

 thread_fast_t ()
 ~thread_fast_t ()
int create (thread_func_t aFunc, void *aData)
 Returns zero if no error.
void join (void)
void cancel (void)
 Called only by the main thread.
bool exec_lock (void)

Private Member Functions

 thread_fast_t (const thread_fast_t &)
thread_fast_toperator= (const thread_fast_t &)
void * funcMethod (void)

Static Private Member Functions

static void * func (void *aThr)

Private Attributes

Mtx _MtxA
Mtx _MtxB
volatile bool isRunning
volatile bool mustExit
volatile thread_func_t _Func
void * _Data


Detailed Description

template<class Thr, class Mtx>
class rpa::thread_fast_t< Thr, Mtx >

Implements 'exec_lock()' method. Very efficient for small tasks because the synchronization is much faster. The main thread executes the code if it has to wait just a short time.


Constructor & Destructor Documentation

template<class Thr, class Mtx>
rpa::thread_fast_t< Thr, Mtx >::thread_fast_t ( const thread_fast_t< Thr, Mtx > &   )  [private]

template<class Thr, class Mtx>
rpa::thread_fast_t< Thr, Mtx >::thread_fast_t (  )  [inline]

template<class Thr, class Mtx>
rpa::thread_fast_t< Thr, Mtx >::~thread_fast_t (  )  [inline]


Member Function Documentation

template<class Thr, class Mtx>
void rpa::thread_fast_t< Thr, Mtx >::cancel ( void   )  [inline]

Called only by the main thread.

template<class Thr, class Mtx>
int rpa::thread_fast_t< Thr, Mtx >::create ( thread_func_t  aFunc,
void *  aData 
) [inline]

Returns zero if no error.

Does not start the real thread if not necessary. If it was stopped, it has to be restarted.

template<class Thr, class Mtx>
bool rpa::thread_fast_t< Thr, Mtx >::exec_lock ( void   )  [inline]

template<class Thr, class Mtx>
static void* rpa::thread_fast_t< Thr, Mtx >::func ( void *  aThr  )  [inline, static, private]

template<class Thr, class Mtx>
void* rpa::thread_fast_t< Thr, Mtx >::funcMethod ( void   )  [inline, private]

template<class Thr, class Mtx>
void rpa::thread_fast_t< Thr, Mtx >::join ( void   )  [inline]

template<class Thr, class Mtx>
thread_fast_t& rpa::thread_fast_t< Thr, Mtx >::operator= ( const thread_fast_t< Thr, Mtx > &   )  [private]


Member Data Documentation

template<class Thr, class Mtx>
void* rpa::thread_fast_t< Thr, Mtx >::_Data [private]

template<class Thr, class Mtx>
volatile thread_func_t rpa::thread_fast_t< Thr, Mtx >::_Func [private]

These two variables are read and written by the main thread and the sub-thread, but all writes are protected by _MtxA

template<class Thr, class Mtx>
Mtx rpa::thread_fast_t< Thr, Mtx >::_MtxA [private]

template<class Thr, class Mtx>
Mtx rpa::thread_fast_t< Thr, Mtx >::_MtxB [private]

template<class Thr, class Mtx>
volatile bool rpa::thread_fast_t< Thr, Mtx >::isRunning [private]

template<class Thr, class Mtx>
volatile bool rpa::thread_fast_t< Thr, Mtx >::mustExit [private]


The documentation for this class was generated from the following file:
Generated on Tue Sep 25 10:20:31 2007 for rpa by  doxygen 1.4.7