OETryMutex

class OETryMutex

This class represents OETryMutex.

The OETryMutex class provides a portable MUTual EXclusion device, that is useful for protecting shared data structures from concurrent modification. This version also contains OETryMutex::Try method that allows for a failed acquire. OETryMutex is slightly more costly than OEMutex.

Constructors

OETryMutex()

Default constructor.

Acquire

void Acquire()

Acquires (locks) the OETryMutex. If the OETryMutex is unlocked, it is locked by this calls and becomes owned by the calling thread. If the OETryMutex is already locked, by this or another thread, OETryMutex::Acquire suspends the calling thread until the OETryMutex is released.

Release

void Release()

Releases (unlocks) the OETryMutex. The OETryMutex object must have previously been locked by the calling thread.

Try

bool Try()

Attempts to acquire (lock) the OETryMutex. If the OETryMutex is unlocked, it is locked by this call, becomes owned by the calling thread, and returns true. If the OETryMutex is already locked, by this or another thread, OETryMutex::Try returns false.