|
DelegateMQ
|
Win32 API implementation of the DelegateMQ IThread interface. More...
#include "delegate/IThread.h"#include "./predef/util/Timer.h"#include "ThreadMsg.h"#include <queue>#include <atomic>#include <optional>#include <string>Go to the source code of this file.
Classes | |
| struct | ThreadMsgComparator |
| class | Thread |
| Cross-platform thread for any system supporting C++11 std::thread (e.g. Windows, Linux). More... | |
Win32 API implementation of the DelegateMQ IThread interface.
This class provides a Windows-native implementation of the IThread interface using Win32 synchronization primitives (CRITICAL_SECTION, CONDITION_VARIABLE, HANDLE). It creates a dedicated worker thread with an event loop capable of processing asynchronous delegates and system messages.
Key Features:
std::priority_queue to ensure high-priority delegate messages (e.g., system signals) are processed before lower-priority ones.maxQueueSize. If the queue is full, DispatchDelegate() blocks the caller until space is available, preventing memory exhaustion.CreateThread() returns.SetThreadDescription() to aid debugging in Visual Studio.