Abstraction of a thread. More...
Abstraction of a thread.
Public Member Methods | |
Thread (Int32 stackSize=DefaultStackSize) | |
Constructor. More... | |
Thread (PCChar8 name, Int32 stackSize=DefaultStackSize) | |
Constructor. More... | |
void | SetName (PCChar8 name) |
Sets the thread name. More... | |
virtual | ~Thread () |
Destructor. More... | |
const String & | GetName () |
Gets the thread name. More... | |
void | Suspend () |
Suspends the thread. More... | |
void | Resume () |
Resumes the thread. More... | |
Int32 | GetThreadID () |
Gets the thread identifier. More... | |
bool | WaitFor (TimeSpan timeOut=TimeInfinite) |
Wait for. More... | |
bool | GetIsTerminated () |
Query if the thread is suspended. More... | |
bool | GetIsSuspended () |
Query if the thread is suspended. More... | |
bool | GetIsCurrentThread () |
Query if this object is current thread. More... | |
void | CheckCurrentThread () |
Check current thread. Check if a the caller of a method of this thread is done outside the owning thread. If not exception is raised. More... | |
Int32 | GetStackSize () |
Gets the stack size. More... | |
Int32 | GetStackUsed () |
Gets the stack used. More... | |
Int32 | GetStackAvailable () |
Gets the stack availability. More... | |
void | SetPriority (ThreadPriority priority) |
Sets the priority. More... | |
ThreadPriority | GetPriority () |
Gets the priority. More... | |
bool | GetIsTimeCritical () |
Query if is it a time critical thread. More... | |
void | SetIsTimeCritical (bool value) |
Sets the thread as time critical. More... | |
void | SetHasViolatedTimeCritical () |
Sets the flag saying that it has violated its time critical feature. More... | |
bool | HasViolatedTimeCritical () |
Query if the tread has violated its time critical feature. More... | |
void | ResetHasViolatedTimeCritical () |
Reset the flag saying that it has violated its time critical feature. More... | |
bool | GetIsAllowedBlockingCode () |
Query if the thread has the permission to call blocking code. More... | |
void | SetBlockingCodePermission (bool permission) |
Sets the thread permission to call blocking code. More... | |
void | SetHasViolatedBlockingCodePermission () |
Sets the flag saying that it has violated its blocking code permission. More... | |
bool | HasViolatedBlockingCodePermission () |
Query if the tread has violated its blocking code permission. More... | |
void | ResetHasViolatedBlockingCodePermission () |
Reset the flag saying that it has violated its blocking code permission. More... | |
void | SetThreadListener (IThreadSectionWaitListener &threadListener) |
Sets the thread listener. More... | |
IThreadSectionWaitListener * | GetThreadListener () |
Gets the thread listener. More... | |
Protected Member Functions | |
virtual void | Execute ()=0 |
The execution of the tread. More... | |
void | InternalExecute () |
Internal execution and preparation of the thread before executing Execute. More... | |
Thread | ( | Int32 | stackSize = DefaultStackSize | ) |
Constructor.
stackSize | (optional) size of the stack. Default = DefaultStackSize. |
Thread | ( | PCChar8 | name, |
Int32 | stackSize = DefaultStackSize |
||
) |
Constructor.
name | Name of the thread. |
stackSize | (optional) size of the stack. Default = DefaultStackSize. |
|
virtual |
Destructor.
void CheckCurrentThread | ( | ) |
Check current thread. Check if a the caller of a method of this thread is done outside the owning thread. If not exception is raised.
|
protectedpure virtual |
The execution of the tread.
This method is called once the thread is Resumed, initialized and ready to execute.
Implemented in ServiceControllerThread, and SyncPersistenceThread.
|
inline |
Query if the thread has the permission to call blocking code.
bool GetIsCurrentThread | ( | ) |
Query if this object is current thread.
bool GetIsSuspended | ( | ) |
Query if the thread is suspended.
bool GetIsTerminated | ( | ) |
Query if the thread is suspended.
|
inline |
Query if is it a time critical thread.
const String& GetName | ( | ) |
Gets the thread name.
ThreadPriority GetPriority | ( | ) |
Gets the priority.
Int32 GetStackAvailable | ( | ) |
Gets the stack availability.
Int32 GetStackSize | ( | ) |
Gets the stack size.
Int32 GetStackUsed | ( | ) |
Gets the stack used.
Int32 GetThreadID | ( | ) |
Gets the thread identifier.
IThreadSectionWaitListener* GetThreadListener | ( | ) |
Gets the thread listener.
|
inline |
Query if the tread has violated its blocking code permission.
|
inline |
Query if the tread has violated its time critical feature.
|
protected |
Internal execution and preparation of the thread before executing Execute.
|
inline |
Reset the flag saying that it has violated its blocking code permission.
|
inline |
Reset the flag saying that it has violated its time critical feature.
void Resume | ( | ) |
Resumes the thread.
|
inline |
Sets the thread permission to call blocking code.
permission | true to allow, false if not. |
By default the thead has the persimission to call blocking code.
|
inline |
Sets the flag saying that it has violated its blocking code permission.
|
inline |
Sets the flag saying that it has violated its time critical feature.
|
inline |
Sets the thread as time critical.
value | true to value. |
void SetName | ( | PCChar8 | name | ) |
Sets the thread name.
name | Name of the thread. |
void SetPriority | ( | ThreadPriority | priority | ) |
Sets the priority.
priority | The priority. |
void SetThreadListener | ( | IThreadSectionWaitListener & | threadListener | ) |
Sets the thread listener.
threadListener | The threadListener. |
void Suspend | ( | ) |
Suspends the thread.
bool WaitFor | ( | TimeSpan | timeOut = TimeInfinite | ) |
Wait for.
timeOut | (optional) the time out. Default = TimeInfinite |