TinyThread++ 1.1
Public Member Functions
mutex Class Reference

Mutex class. More...

#include <tinythread.h>

List of all members.

Public Member Functions

 mutex ()
 ~mutex ()
void lock ()
 Lock the mutex.
bool try_lock ()
 Try to lock the mutex.
void unlock ()
 Unlock the mutex.

Detailed Description

Mutex class.

This is a mutual exclusion object for synchronizing access to shared memory areas for several threads. The mutex is non-recursive (i.e. a program may deadlock if the thread that owns a mutex object calls lock() on that object).

See also:

Member Function Documentation

void lock ( ) [inline]

Lock the mutex.

The method will block the calling thread until a lock on the mutex can be obtained. The mutex remains locked until unlock() is called.

See also:
bool try_lock ( ) [inline]

Try to lock the mutex.

The method will try to lock the mutex. If it fails, the function will return immediately (non-blocking).

true if the lock was acquired, or false if the lock could not be acquired.
void unlock ( ) [inline]

Unlock the mutex.

If any threads are waiting for the lock on this mutex, one of them will be unblocked.

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