Generic counting mutex for synchronization of thread jobs. More...
Public Member Functions | |
| D_CORE_API | ndSyncMutex () |
| Create and initialize counter to zero. | |
| D_CORE_API | ~ndSyncMutex () |
| Destroy mutex. | |
| D_CORE_API void | Sync () |
| Synchronize with another worker threads. More... | |
| D_CORE_API void | Tick () |
| Increment internal variable m_count by one. | |
| D_CORE_API void | Release () |
| Decrement internal variable m_count by one and signal the thread to wakeup. | |
Generic counting mutex for synchronization of thread jobs.
| void ndSyncMutex::Sync | ( | ) |
Synchronize with another worker threads.
When internal variable m_counter larger than zero, this function blocks the calling thread until another thread call member function Release.
When counter is zero, this function return immediately.