#include <wefts_os_base.h>
Inheritance diagram for Wefts::OSThreadBase:
Public Methods | |
virtual bool | start (void *(*func)(void *), void *data)=0 |
Starts OS specific thread OS dependant implementation must provide a valid function to execute the thread; Thread.cpp has already some valid ones. | |
virtual bool | stop ()=0 |
Stop this OS specific thread. | |
virtual void * | join ()=0 |
Joins this OS Specific threads. | |
virtual int | enableCancel ()=0 |
Enables cancelation: This function returns the old status on success, that can be later reset with setCancelStatus. | |
virtual int | disableCancel ()=0 |
Disables cancelation. | |
virtual bool | setCancelState (int state)=0 |
Raw function to set the cancel type. | |
virtual void | testCancel ()=0 |
Kill the thread on OS level cancelation. | |
virtual void | setCancelDeferred ()=0 |
Tells the thread that it must use deferred cancelation. | |
virtual void | detach ()=0 |
Detach thread. | |
virtual bool | same () const=0 |
Returns true if the currently running thread and this objects are the same. | |
virtual bool | equal (const OSThreadBase &th) const=0 |
Returns true if this object is equal (on OS opinion) to the parameter. | |
virtual bool | setCurrent ()=0 |
Change this thread object to the current OS dependant thread. | |
virtual void | invalidate ()=0 |
virtual bool | operator== (OSThreadBase &th) |
Pass the test to equal(). | |
virtual bool | operator!= (OSThreadBase &th) |
Pass the thest to ! equal(). | |
Protected Methods | |
OSThreadBase () | |
Newly created thread. | |
OSThreadBase (bool) | |
Already running thread. | |
virtual void | exit (void *data)=0 |
Exit the thread. |
|
Newly created thread. Subclassess must calll invalidate() member to specify that the current thread is still not running. |
|
Already running thread. Call this constructor if you need to have a reference to the thread that is currently running; this will set the OSThreadBase internal data as if a start were called at some point. |
|
Detach thread.
Implemented in Wefts::OSThreadPthread. |
|
Disables cancelation. Wokrs like enableCancel.
Implemented in Wefts::OSThreadPthread. |
|
Enables cancelation: This function returns the old status on success, that can be later reset with setCancelStatus. On error, return type is undefined.
Implemented in Wefts::OSThreadPthread. |
|
Returns true if this object is equal (on OS opinion) to the parameter.
Implemented in Wefts::OSThreadPthread. |
|
Exit the thread. Run() can call this method instead of retunring a void *; the effect is the same. Implemented in Wefts::OSThreadPthread. |
|
Implemented in Wefts::OSThreadPthread. |
|
Joins this OS Specific threads.
Implemented in Wefts::OSThreadPthread. |
|
Pass the thest to ! equal().
|
|
Pass the test to equal().
|
|
Returns true if the currently running thread and this objects are the same.
Implemented in Wefts::OSThreadPthread. |
|
Tells the thread that it must use deferred cancelation. The OS may provide deferred cancelation schemes natively, or not. In the latter case, deferred cancelation must be emulated; See Cancellation Issues. Implemented in Wefts::OSThreadPthread. |
|
Raw function to set the cancel type. This function should be used only with the integer returned by enableCancel() and disableCancel(), as no assumption can be made about what the meaning of the parameter could be in different environments.
Implemented in Wefts::OSThreadPthread. |
|
Change this thread object to the current OS dependant thread. It makes so that all the internal variables are set to reflect this current thread. In some implementation, updating of some variables my be deferred to a later moment; the important thing is to change the thread type. Implemented in Wefts::OSThreadPthread. |
|
Starts OS specific thread OS dependant implementation must provide a valid function to execute the thread; Thread.cpp has already some valid ones.
Implemented in Wefts::OSThreadPthread. |
|
Stop this OS specific thread.
Implemented in Wefts::OSThreadPthread. |
|
Kill the thread on OS level cancelation.
Implemented in Wefts::OSThreadPthread. |