#include <tnlThread.h>
Inheritance diagram for TNL::ThreadQueue:

Public Methods | |
| ThreadQueue (U32 threadCount) | |
| ThreadQueue constructor. threadCount specifies the number of worker threads that will be created. | |
| void | dispatchResponseCalls () |
| Dispatches all ThreadQueue calls queued by worker threads. | |
Protected Methods | |
| void | lock () |
| Locks the ThreadQueue for access to member variables. | |
| void | unlock () |
| Unlocks the ThreadQueue. | |
| void | postCall (Functor *theCall) |
| Posts a marshalled call onto either the worker thread call list or the response call list. | |
| void | dispatchNextCall () |
| Dispatches the next available worker thread call. Called internally by the worker threads when they awaken from the semaphore. | |
| bool | isMainThread () |
| helper function to determine if the currently executing thread is a worker thread or the main thread. | |
| virtual void | threadStart () |
| called by each worker thread when it starts for subclass initialization of worker threads. | |
ThreadQueue methods declared with the TNL_DECLARE_THREADQ_METHOD macro are special -- if they are called from the main thread, they will be executed on one of the worker threads and vice versa.
Definition at line 151 of file tnlThread.h.
|
|
Dispatches all ThreadQueue calls queued by worker threads. This should be called periodically from a main loop. Definition at line 287 of file thread.cpp. References TNL::Vector< Functor * >::clear(), TNL::Functor::dispatch(), lock(), TNL::Vector< Functor * >::size(), and unlock(). |
1.2.18