Base class for thread.
Inheritance:
Public Methods
-
static void join(HANDLE id) throw(ThreadingExceptions::Failure)
- join current thread with argument.
-
static void join(const Thread& th) throw(ThreadingExceptions::Failure)
- join current thread with thread <code> th </code>
-
Thread() throw(ThreadingExceptions::NoMemory)
-
virtual ~Thread()
-
id_type id() const throw()
- return system-depended id of started thread
-
static id_type current_id() throw()
- return id of current thread
-
int error_code() const throw()
- return error code of last thread operation; 0 if all is good, otherwise - system depended nonzero value
-
virtual void run() = 0
- library user must put all work of thread here
-
bool is_running() const throw(ThreadingExceptions::NoResources, ThreadingExceptions::InternalError)
- Is thread running ?
-
void start() throw(ThreadingExceptions::NoResources, ThreadingExceptions::InternalError)
- start thread
-
void cancel() throw()
- cancel thread
-
ThreadContext* getContext()
- get context of thread.
-
static void sleepCurrent(unsigned int sec) throw()
- sleep, yield and test cancelation points
-
static void nanosleepCurrent(unsigned int sec, long nsec) throw()
- sleep, yield and test cancelation points
-
static void yield()
- yield
Protected Methods
-
void exit(void) throw()
- exit from thread
-
void testcancel(void) throw()
- test for cancelation point
-
void sleep(unsigned int sec) throw()
- sleep, yield and test for cancelation point
-
void nanosleep(unsigned int sec, long nsec) throw()
- sleep, yield and test for cancelation point
Documentation
Base class for thread.
Library users create own threads by inherienting from this class
and overriding run() method.
static void join(HANDLE id) throw(ThreadingExceptions::Failure)
-
join current thread with argument.
note, that all thread must be joined
with main thread after completition.
By default this is done in thread
destructor
static void join(const Thread& th) throw(ThreadingExceptions::Failure)
-
join current thread with thread <code> th </code>
Thread() throw(ThreadingExceptions::NoMemory)
virtual ~Thread()
id_type id() const throw()
-
return system-depended id of started thread
static id_type current_id() throw()
-
return id of current thread
int error_code() const throw()
-
return error code of last thread operation;
0 if all is good, otherwise - system depended
nonzero value
virtual void run() = 0
-
library user must put all work of thread here
bool is_running() const throw(ThreadingExceptions::NoResources, ThreadingExceptions::InternalError)
-
Is thread running ?
- Returns:
- true, if thread is running; false otherwise.
void start() throw(ThreadingExceptions::NoResources, ThreadingExceptions::InternalError)
-
start thread
void cancel() throw()
-
cancel thread
ThreadContext* getContext()
-
get context of thread. automatically create one if it does not exists.
static void sleepCurrent(unsigned int sec) throw()
-
sleep, yield and test cancelation points
static void nanosleepCurrent(unsigned int sec, long nsec) throw()
-
sleep, yield and test cancelation points
static void yield()
-
yield
void exit(void) throw()
-
exit from thread
void testcancel(void) throw()
-
test for cancelation point
void sleep(unsigned int sec) throw()
-
sleep, yield and test for cancelation point
void nanosleep(unsigned int sec, long nsec) throw()
-
sleep, yield and test for cancelation point
- Direct child classes:
- SingleThreadReactive
SingleThreadChecking
Alphabetic index HTML hierarchy of classes or Java
This page was generated with the help of DOC++.