OnixS C++ FIX Engine  4.2.0
API Documentation
Mutex Class Reference

#include <OnixS/FIXEngine/Threading/Mutex.h>

Public Member Functions

friend ONIXS_FIXENGINE_API_DECL (class, Condition)
 Mutex ()
 ~Mutex ()
void acquire ()
bool tryAcquire ()
void release ()

Detailed Description

Only one thread at a time can own instance of this class.

This implementation is optimized for locking threads that are in the same process.

It is NOT suitable for use for interprocess synchronization.
Recursive locking is NOT supported.

Definition at line 34 of file Mutex.h.

Constructor & Destructor Documentation

Mutex ( )

Initializes the instance.

~Mutex ( )

Destructs the instance.

Member Function Documentation

void acquire ( )

Acquires lock ownership.

If Mutex already occupied by the other thread, block current thread and waits until it will be released by the owner.

void release ( )

Releases the ownership (lock) and unblocks one of waiting threads.

bool tryAcquire ( )

Acquires lock ownership if Mutex is not owned by any thread.

If Mutex is already owned by the other thread, returns false. In either cases it doesn't block thread and quites immediately.

The documentation for this class was generated from the following file: