CMsgThread Class (Compact 2013)
3/26/2014
CMsgThread Class
This class is a worker thread class that queues requests to the queuing thread for completion asynchronously.
To use this class, derive your class from it and override the CMsgThread::ThreadMessageProc member function.
The ThreadMessageProc member function carries out each request. Your client functions and the ThreadMessageProc member function must share a common definition of the parameters in the CMsg object.
A negotiated mechanism tells the worker thread to exit. Typically, this is one value of the CMsg class's uMsg message code.
It is a good idea to send this message from the destructor of your derived class and call the CMsgThread::WaitForThreadExit member function before completing the destruction of the derived class.
Protected Data Members
Member |
Description |
---|---|
m_hSem |
Indicates a handle used for signaling. |
m_Lock |
Protects access to lists. |
m_lWaiting |
Indicates waiting for a free thread. |
m_ThreadQueue |
Overrides the CMsgThread::GetThreadMsg member function and blocks on things other than this queue. |
Member Functions
Member function |
Description |
---|---|
Constructs a CMsgThread object. |
|
Creates a thread. |
|
Returns the thread handle. |
|
Returns the identifier of the thread. |
|
Retrieves the current thread priority. |
|
Queues a request for execution by the worker thread. |
|
Continues the operation of the worker thread. |
|
Sets the priority of the thread to a new value. |
|
Suspends the operation of a running thread. |
|
Blocks until the thread has exited after a call to the CMsgThread::SuspendThread member function. |
Overrideable Member Functions
Member function |
Description |
---|---|
Retrieves a queued CMsg object containing a request. |
|
Provides initialization on a thread. |
|
Processes requests. This is a pure virtual member function. |
Requirements
Header |
dshow.h, |
Library |
ole32.lib, |