Classes | Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
XThread< T > Class Template Reference

create a new thread. More...

#include <xthread.h>

Inheritance diagram for XThread< T >:
Inheritance graph
[legend]

Classes

struct  targ
 

Public Member Functions

template<class X >
 XThread (const shared_ptr< X > &t, void *(T::*func)(const atomic< bool > &))
 
void resume ()
 resume a new thread.
 
void waitFor (void **retval=0L)
 
void terminate ()
 set termination flag.
 
bool isTerminated () const
 fetch termination flag.
 

Static Private Member Functions

static void * xthread_start_routine (void *)
 

Private Attributes

shared_ptr< targm_startarg
 
pthread_t m_threadid
 
std::thread m_thread
 

Detailed Description

template<class T>
class XThread< T >

create a new thread.

Definition at line 170 of file xthread.h.

Constructor & Destructor Documentation

template<class T>
template<class X >
XThread< T >::XThread ( const shared_ptr< X > &  t,
void *(T::*)(const atomic< bool > &)  func 
)

use resume() to start a thread. X must be super class of T.

Definition at line 209 of file xthread.h.

Member Function Documentation

template<class T >
void XThread< T >::waitFor ( void **  retval = 0L)

join a running thread. should be called before destruction.

Parameters
retvala pointer to return value from a thread.

Definition at line 259 of file xthread.h.


The documentation for this class was generated from the following file:

Generated for KAME4 by  doxygen 1.8.3