gloox  1.0.16
Public Member Functions | List of all members
Mutex Class Reference

#include <mutex.h>

Public Member Functions

 Mutex ()
 
 ~Mutex ()
 
void lock ()
 
bool trylock ()
 
void unlock ()
 

Detailed Description

A simple implementation of mutex as a wrapper around a pthread mutex or a win32 critical section.

If you locked a mutex you MUST unlock it within the same thread.

Author
Jakob Schröter js@ca.nosp@m.maya.nosp@m..net
Since
0.9

Definition at line 33 of file mutex.h.

Constructor & Destructor Documentation

Mutex ( )

Contructs a new simple mutex.

Definition at line 111 of file mutex.cpp.

~Mutex ( )

Destructor

Definition at line 116 of file mutex.cpp.

Member Function Documentation

void lock ( )

Locks the mutex.

Definition at line 121 of file mutex.cpp.

bool trylock ( )

Tries to lock the mutex.

Returns
True if the attempt was successful, false otherwise.
Note
This function also returns true if mutex support is not available, ie. if gloox is compiled without pthreads on non-Windows platforms. Make sure threads/mutexes are available if your code relies on trylock().

Definition at line 126 of file mutex.cpp.

void unlock ( )

Releases the mutex.

Definition at line 131 of file mutex.cpp.


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