xmltooling  3.0.1
xmltooling::Thread Class Referenceabstract

A class for manual thread creation and synchronization. More...

#include <xmltooling/util/Threads.h>

Public Member Functions

virtual int detach ()=0
 Disassociate from the thread. More...
 
virtual int join (void **thread_return)=0
 Join with the thread and wait for its completion. More...
 
virtual int kill (int signo)=0
 Kill the thread. More...
 

Static Public Member Functions

static Threadcreate (void *(*start_routine)(void *), void *arg, size_t stacksize=0)
 Creates a new thread object to run the supplied start routine. More...
 
static void exit (void *return_val)
 Exits a thread gracefully. More...
 
static void sleep (int seconds)
 Sleeps the current thread for the specified amount of time. More...
 
static void mask_all_signals (void)
 Masks all signals from a thread.
 
static int mask_signals (int how, const sigset_t *newmask, sigset_t *oldmask)
 Masks specific signals from a thread. More...
 

Detailed Description

A class for manual thread creation and synchronization.

Member Function Documentation

static Thread* xmltooling::Thread::create ( void *(*)(void *)  start_routine,
void *  arg,
size_t  stacksize = 0 
)
static

Creates a new thread object to run the supplied start routine.

Parameters
start_routinethe function to execute on the thread
arga parameter for the start routine
stacksizesize of stack to use, or 0 for default
Returns
the created and running thread object
virtual int xmltooling::Thread::detach ( )
pure virtual

Disassociate from the thread.

Returns
0 for success, non-zero for failure
static void xmltooling::Thread::exit ( void *  return_val)
static

Exits a thread gracefully.

Parameters
return_valthe return value for the thread
virtual int xmltooling::Thread::join ( void **  thread_return)
pure virtual

Join with the thread and wait for its completion.

Parameters
thread_returnholds the return value of the thread routine
Returns
0 for success, non-zero for failure
virtual int xmltooling::Thread::kill ( int  signo)
pure virtual

Kill the thread.

Parameters
signothe signal to send to the thread
Returns
0 for success, non-zero for failure
static int xmltooling::Thread::mask_signals ( int  how,
const sigset_t *  newmask,
sigset_t *  oldmask 
)
static

Masks specific signals from a thread.

Parameters
how
newmaskthe new signal mask
oldmaskthe old signal mask
Returns
0 for success, non-zero for failure
static void xmltooling::Thread::sleep ( int  seconds)
static

Sleeps the current thread for the specified amount of time.

Parameters
secondstime to sleep

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