Public Types | Public Member Functions

FbxThread Class Reference

Search for all occurrences

Detailed Description

This class implement a standard way to use threads across platforms.

Definition at line 29 of file fbxthread.h.

#include <fbxthread.h>

List of all members.

Public Types

enum  EState { eUnknown, eRunning, eDead }
enum  EPriority {
  eNone, eIdle, eLowest, eLow,
  eNormal, eHigh, eHighest, eRealTime
}

Public Member Functions

 FbxThread (FbxThreadProc pProc, void *pArg, bool pSuspend=false)
 Constructor.
 FbxThread (FbxThreadProc pProc, void *pArg, EPriority pPriority, bool pSuspend=false)
 Constructor.
virtual ~FbxThread ()
 Destructor.
bool Suspend ()
 Suspend the execution of the thread.
bool Resume ()
 Resume the execution of the thread.
bool Join ()
 Wait for the thread completion.
bool Kill ()
 Do not wait for the thread completion and terminate it.
EPriority GetPriority ()
 Retrieve the priority of the thread.
bool SetPriority (EPriority pPriority)
 Set the thread priority.
EState GetState ()
 Retrieve the thread current state.

Member Enumeration Documentation

enum EState
enum EPriority

Constructor & Destructor Documentation

FbxThread ( FbxThreadProc  pProc,
void *  pArg,
bool  pSuspend = false 
)

Constructor.

Parameters:
pProcThe procedure called upon thread startup.
pArgThe arguments passed to the procedure.
pSuspendStart the thread suspended.
FbxThread ( FbxThreadProc  pProc,
void *  pArg,
EPriority  pPriority,
bool  pSuspend = false 
)

Constructor.

Parameters:
pProcThe procedure called upon thread startup.
pArgThe arguments passed to the procedure.
pPriorityThe thread priority to set upon creation.
pSuspendStart the thread suspended.
virtual ~FbxThread ( ) [virtual]

Destructor.


Member Function Documentation

bool Suspend ( )

Suspend the execution of the thread.

Returns:
Return true if the thread was successfully suspended, otherwise false.
Remarks:
It should be used only if you can control where the thread will be suspended in its procedure, otherwise the state of the thread and its memory is unknown, since the code will stop anywhere.
bool Resume ( )

Resume the execution of the thread.

Returns:
Return true if the thread was successfully resumed, otherwise false.
bool Join ( )

Wait for the thread completion.

Returns:
True if the thread successfully returned from its procedure.
bool Kill ( )

Do not wait for the thread completion and terminate it.

Returns:
True if the thread successfully died.
EPriority GetPriority ( )

Retrieve the priority of the thread.

Returns:
The thread's priority.
bool SetPriority ( EPriority  pPriority)

Set the thread priority.

Parameters:
pPriorityThe priority to set to this thread.
Returns:
True if the thread priority was successfully changed.
EState GetState ( )

Retrieve the thread current state.

Returns:
The state of the thread.

The documentation for this class was generated from the following file:

FbxThread FbxThread FbxThread FbxThread FbxThread FbxThread FbxThread FbxThread FbxThread FbxThread
FbxThread FbxThread FbxThread FbxThread FbxThread FbxThread FbxThread FbxThread FbxThread FbxThread