Newton Dynamics  4.00
dSyncMutex Class Reference

Generic counting mutex for synchronization of thread jobs. More...

Inheritance diagram for dSyncMutex:
dThreadPool ndScene ndSceneMixed ndWorldScene< ndSceneMixed > ndWorldMixedScene ndWorldSegregatedScene

Public Member Functions

D_CORE_API dSyncMutex ()
 Create and initialize counter to zero.
 
D_CORE_API ~dSyncMutex ()
 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.
 

Detailed Description

Generic counting mutex for synchronization of thread jobs.

Member Function Documentation

◆ Sync()

void dSyncMutex::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.