UA Server SDK C++ Bundle  1.4.1.271
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
UaMutex Class Reference

The UaMutex class provides access serialization between threads. More...

#include <uamutex.h>

Inherited by UaMutexRefCounted.

Public Member Functions

 UaMutex ()
 construction Constructs a UaMutex object that allows threads to lock() the mutex to block access to a resource.
 
 ~UaMutex ()
 destruction Destroys the UaMutex object. More...
 
void lock ()
 Attempts to lock the mutex. More...
 
void unlock ()
 Unlocks the mutex. More...
 

Detailed Description

The UaMutex class provides access serialization between threads.

The purpose of a UaMutex is to protect an object, data structure or section of code so that only one thread can access it at a time (this is similar to the Java synchronized keyword). It is usually best to use a mutex with a UaMutexLocker since this makes it easy to ensure that locking and unlocking are performed consistently. It is not possible to create plane copies of this Class.

Constructor & Destructor Documentation

UaMutex::~UaMutex ( )

destruction Destroys the UaMutex object.

Warning
If you destroy a mutex that has accesses in use the resultant behavior is undefined.

Member Function Documentation

void UaMutex::lock ( )

Attempts to lock the mutex.

This function will block the current thread if the mutex is already locked.

See Also
unlock()
void UaMutex::unlock ( )

Unlocks the mutex.


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