OnixS C++ CME MDP Conflated TCP Handler  1.3.6
API Documentation
Mutex Class Reference

#include <OnixS/CME/ConflatedTCP/threading/Mutex.h>

Public Member Functions

 Mutex ()
 
 ~Mutex ()
 
void acquire ()
 
bool tryAcquire ()
 
void release ()
 

Friends

class Condition
 

Detailed Description

Protects resources from simultaneous access by multiple threads.

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.

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

Definition at line 39 of file Mutex.h.

Constructor & Destructor Documentation

Mutex ( )

Initializes the instance.

~Mutex ( )

Destructs the instance.

Member Function Documentation

void acquire ( )

Acquires the lock ownership.

If the mutex is already occupied by another thread blocks the current thread and waits until it will be released by the owner.

void release ( )

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

bool tryAcquire ( )

Tries to acquires the lock ownership.

Returns
false if the mutex is already occupied by another thread, otherwise - true.

Friends And Related Function Documentation

friend class Condition
friend

Definition at line 42 of file Mutex.h.


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