class GradSoft::Thread

Base class for thread.

Inheritance:


Public Methods

[more]static void join(HANDLE id) throw(ThreadingExceptions::Failure)
join current thread with argument.
[more]static void join(const Thread& th) throw(ThreadingExceptions::Failure)
join current thread with thread <code> th </code>
[more] Thread() throw(ThreadingExceptions::NoMemory)
[more]virtual ~Thread()
[more]id_type id() const throw()
return system-depended id of started thread
[more]static id_type current_id() throw()
return id of current thread
[more]int error_code() const throw()
return error code of last thread operation; 0 if all is good, otherwise - system depended nonzero value
[more]virtual void run() = 0
library user must put all work of thread here
[more]bool is_running() const throw(ThreadingExceptions::NoResources, ThreadingExceptions::InternalError)
Is thread running ?
[more]void start() throw(ThreadingExceptions::NoResources, ThreadingExceptions::InternalError)
start thread
[more]void cancel() throw()
cancel thread
[more]ThreadContext* getContext()
get context of thread.
[more]static void sleepCurrent(unsigned int sec) throw()
sleep, yield and test cancelation points
[more]static void nanosleepCurrent(unsigned int sec, long nsec) throw()
sleep, yield and test cancelation points
[more]static void yield()
yield

Protected Methods

[more]void exit(void) throw()
exit from thread
[more]void testcancel(void) throw()
test for cancelation point
[more]void sleep(unsigned int sec) throw()
sleep, yield and test for cancelation point
[more]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.
ostatic 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

ostatic void join(const Thread& th) throw(ThreadingExceptions::Failure)
join current thread with thread <code> th </code>

o Thread() throw(ThreadingExceptions::NoMemory)

ovirtual ~Thread()

oid_type id() const throw()
return system-depended id of started thread

ostatic id_type current_id() throw()
return id of current thread

oint error_code() const throw()
return error code of last thread operation; 0 if all is good, otherwise - system depended nonzero value

ovirtual void run() = 0
library user must put all work of thread here

obool is_running() const throw(ThreadingExceptions::NoResources, ThreadingExceptions::InternalError)
Is thread running ?
Returns:
true, if thread is running; false otherwise.

ovoid start() throw(ThreadingExceptions::NoResources, ThreadingExceptions::InternalError)
start thread

ovoid cancel() throw()
cancel thread

oThreadContext* getContext()
get context of thread. automatically create one if it does not exists.

ostatic void sleepCurrent(unsigned int sec) throw()
sleep, yield and test cancelation points

ostatic void nanosleepCurrent(unsigned int sec, long nsec) throw()
sleep, yield and test cancelation points

ostatic void yield()
yield

ovoid exit(void) throw()
exit from thread

ovoid testcancel(void) throw()
test for cancelation point

ovoid sleep(unsigned int sec) throw()
sleep, yield and test for cancelation point

ovoid 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++.