Open CASCADE Technology  7.4.0
Public Member Functions

OSD_ThreadPool::EnumeratedThread Class Reference

Thread with back reference to thread pool and thread index in it. More...

#include <OSD_ThreadPool.hxx>

Inheritance diagram for OSD_ThreadPool::EnumeratedThread:
Inheritance graph
[legend]

Public Member Functions

 EnumeratedThread (bool theIsSelfThread=false)
 Main constructor. More...
 
bool Lock ()
 Occupy this thread for thread pool launcher. More...
 
void Free ()
 Release this thread for thread pool launcher; should be called only after successful OccupyThread(). More...
 
void WakeUp (JobInterface *theJob, bool theToCatchFpe)
 Wake up the thread. More...
 
void WaitIdle ()
 Wait the thread going into Idle state (finished jobs). More...
 
 EnumeratedThread (const EnumeratedThread &theCopy)
 Copy constructor. More...
 
EnumeratedThreadoperator= (const EnumeratedThread &theCopy)
 Assignment operator. More...
 
void Assign (const EnumeratedThread &theCopy)
 Assignment operator. More...
 
- Public Member Functions inherited from OSD_Thread
 OSD_Thread ()
 Empty constructor. More...
 
 OSD_Thread (const OSD_ThreadFunction &func)
 Initialize the tool by the thread function. More...
 
 OSD_Thread (const OSD_Thread &other)
 Copy constructor. More...
 
void Assign (const OSD_Thread &other)
 Copy thread handle from other OSD_Thread object. More...
 
void operator= (const OSD_Thread &other)
 
 ~OSD_Thread ()
 Destructor. Detaches the thread if it wasn't done already. More...
 
void SetPriority (const Standard_Integer thePriority)
 
void SetFunction (const OSD_ThreadFunction &func)
 Initialize the tool by the thread function. If the current thread handle is not null, nullifies it. More...
 
Standard_Boolean Run (const Standard_Address data=0, const Standard_Integer WNTStackSize=0)
 Starts a thread with thread function given in constructor, passing the specified input data (as void *) to it. The parameter WNTStackSize (on Windows only) specifies size of the stack to be allocated for the thread (by default - the same as for the current executable). Returns True if thread started successfully. More...
 
void Detach ()
 Detaches the execution thread from this Thread object, so that it cannot be waited. Note that mechanics of this operation is different on UNIX/Linux (the thread is put to detached state) and Windows (the handle is closed). However, the purpose is the same: to instruct the system to release all thread data upon its completion. More...
 
Standard_Boolean Wait ()
 Waits till the thread finishes execution. More...
 
Standard_Boolean Wait (Standard_Address &theResult)
 Wait till the thread finishes execution. Returns True if wait was successful, False in case of error. More...
 
Standard_Boolean Wait (const Standard_Integer time, Standard_Address &theResult)
 Waits for some time and if the thread is finished, it returns the result. The function returns false if the thread is not finished yet. More...
 
Standard_ThreadId GetId () const
 Returns ID of the currently controlled thread ID, or 0 if no thread is run. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from OSD_Thread
static Standard_ThreadId Current ()
 Auxiliary: returns ID of the current thread. More...
 

Detailed Description

Thread with back reference to thread pool and thread index in it.

Constructor & Destructor Documentation

◆ EnumeratedThread() [1/2]

OSD_ThreadPool::EnumeratedThread::EnumeratedThread ( bool  theIsSelfThread = false)
inline

Main constructor.

◆ EnumeratedThread() [2/2]

OSD_ThreadPool::EnumeratedThread::EnumeratedThread ( const EnumeratedThread theCopy)
inline

Copy constructor.

Member Function Documentation

◆ Assign()

void OSD_ThreadPool::EnumeratedThread::Assign ( const EnumeratedThread theCopy)
inline

Assignment operator.

◆ Free()

void OSD_ThreadPool::EnumeratedThread::Free ( )

Release this thread for thread pool launcher; should be called only after successful OccupyThread().

◆ Lock()

bool OSD_ThreadPool::EnumeratedThread::Lock ( )

Occupy this thread for thread pool launcher.

Returns
TRUE on success, or FALSE if thread has been already occupied

◆ operator=()

EnumeratedThread& OSD_ThreadPool::EnumeratedThread::operator= ( const EnumeratedThread theCopy)
inline

Assignment operator.

◆ WaitIdle()

void OSD_ThreadPool::EnumeratedThread::WaitIdle ( )

Wait the thread going into Idle state (finished jobs).

◆ WakeUp()

void OSD_ThreadPool::EnumeratedThread::WakeUp ( JobInterface theJob,
bool  theToCatchFpe 
)

Wake up the thread.


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