![]() |
Thread++
Client-Server Multithreading with C++
|
The thread class. More...
#include <Thread.h>
Public Member Functions | |
| CThread (size_t) | |
| Constructor. More... | |
| void | operator() () |
| The code that gets run by each thread. More... | |
Protected Attributes | |
| size_t | m_nThreadId = 0 |
| Thread identifier. | |
Additional Inherited Members | |
Static Protected Attributes inherited from CCommon< CTaskClass > | |
| static CThreadSafeQueue< CTaskClass * > | m_qRequest |
| Request queue. | |
| static CThreadSafeQueue< CTaskClass * > | m_qResult |
| Result queue. | |
| static bool | m_bForceExit = false |
| Force exit flag. | |
Values and functionality for the threads.
| CTaskClass | Task descriptor. |
Constructor.
| n | Thread identifier. |
| CTaskClass | Task descriptor. |
| void CThread< CTaskClass >::operator() |
The function executed by a thread, which repeatedly pops a task from the thread-safe request queue, calls its Perform() function, then places it on the result queue. It exits when the request queue is empty or when an exit is forced by CCommon<CTaskClass>::m_bForceExit being set to true.
| CTaskClass | Task descriptor. |