#include <wefts_os_windows.h>
Inheritance diagram for Wefts::OSThreadWindows:
Public Methods | |
OSThreadWindows () | |
OSThreadWindows (bool val) | |
~OSThreadWindows () | |
bool | start (void *(*func)(void *), void *data) |
Starts OS specific thread OS dependant implementation must provide a valid function to execute the thread; Thread.cpp has already some valid ones. | |
bool | stop () |
Stop this OS specific thread. | |
void * | join () throw ( NotJoinableError ) |
Joins this OS Specific threads. | |
int | enableCancel () |
We support only deferred emulated cancelation. | |
int | disableCancel () |
We support only deferred emulated cancelation. | |
bool | setCancelState (int state) |
Raw function to set the cancel type. | |
virtual void | osRun (void(*func)(void *), void *data, void(*cleanup)(void *)) |
Executes a procedure under the hood of a cleanup procedure This method requires the underlying OS threading system to set up a single cleanup procedure, execute the procedure "func" and then call the cleanup procedure; if the thread is canceled, os system must provide. | |
void | testCancel () |
Kill the thread on OS level cancelation. | |
void | setCancelDeferred () |
Always in emulated deferred mode. | |
void | detach () |
Detach thread. | |
void | exit (void *data) |
Exit the thread. | |
bool | same () const |
Returns true if the currently running thread and this objects are the same. | |
bool | equal (const OSThreadBase &th) const |
Returns true if this object is equal (on OS opinion) to the parameter. | |
virtual bool | setCurrent () |
Change this thread object to the current OS dependant thread. | |
virtual void | invalidate () |
Private Attributes | |
DWORD | m_thid |
windows thread id | |
HANDLE | m_hth |
Windows thread handle. | |
bool | m_valid |
true if this thread is considered valid | |
HANDLE | m_evtCancel |
Cancelation control. | |
bool | m_wasCanceled |
Used to reset cancel event after a section where cancelation is disabled. | |
bool | m_canCancel |
Kind cancelation control. | |
void(* | m_rawCleanup )(void *) |
Pointer to thread raw cleanup function. | |
void * | m_rawCleanData |
Pointer to thread raw cleanup data. | |
Friends | |
class | OSConditionWindows |
class | OSFileFuncWin |
bool | OSSleep (long nSeconds, long nNanoseconds) |
Function to provide a wefts-interruptable wait. |
|
|
|
|
|
|
|
Detach thread.
Implements Wefts::OSThreadBase. |
|
We support only deferred emulated cancelation.
Implements Wefts::OSThreadBase. |
|
We support only deferred emulated cancelation.
Implements Wefts::OSThreadBase. |
|
Returns true if this object is equal (on OS opinion) to the parameter.
Implements Wefts::OSThreadBase. |
|
Exit the thread. Run() can call this method instead of retunring a void *; the effect is the same. Implements Wefts::OSThreadBase. |
|
Implements Wefts::OSThreadBase. |
|
Joins this OS Specific threads.
Implements Wefts::OSThreadBase. |
|
Executes a procedure under the hood of a cleanup procedure This method requires the underlying OS threading system to set up a single cleanup procedure, execute the procedure "func" and then call the cleanup procedure; if the thread is canceled, os system must provide. "data" to the cleanup procedure and exit cleanly. Data is actually a Wefts::Thread or derived object, but the data must be considered opaque to os layer. Currently func() is only a wrapper to call data->run(), but this may change in the future. Implements Wefts::OSThreadBase. |
|
Returns true if the currently running thread and this objects are the same.
Implements Wefts::OSThreadBase. |
|
Always in emulated deferred mode.
Implements Wefts::OSThreadBase. |
|
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.
Implements Wefts::OSThreadBase. |
|
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. Implements Wefts::OSThreadBase. |
|
Starts OS specific thread OS dependant implementation must provide a valid function to execute the thread; Thread.cpp has already some valid ones.
Implements Wefts::OSThreadBase. |
|
Stop this OS specific thread.
Implements Wefts::OSThreadBase. |
|
Kill the thread on OS level cancelation.
Implements Wefts::OSThreadBase. |
|
|
|
|
|
Function to provide a wefts-interruptable wait.
|
|
Kind cancelation control.
|
|
Cancelation control.
|
|
Windows thread handle.
|
|
Pointer to thread raw cleanup data. This pointer holds generally a pointer to a Wefts::Thread or subclass, and is initializated in osRun() by functions in wefts_thread.c |
|
Pointer to thread raw cleanup function. This function is usually defined in wefts_thread.c and has the duty to call the high-level thread layer. |
|
windows thread id
|
|
true if this thread is considered valid
|
|
Used to reset cancel event after a section where cancelation is disabled. disableCancel will set this to true if the event that commands the thread to be canceled was set. Then if enableCancel is issued, the event is set again if it was set before. |