UtiLite  0.3.1
A lite utilities library
UScopeMutex Class Reference

#include <UMutex.h>

List of all members.


Detailed Description

Automatically lock the referenced mutex on constructor and unlock mutex on destructor.

Example:

 UMutex m; // Mutex shared with another thread(s).
 ...
 int myMethod()
 {
    UScopeMutex sm(m); // automatically lock the mutex m
    if(cond1)
    {
       return 1; // automatically unlock the mutex m
    }
    else if(cond2)
    {
       return 2; // automatically unlock the mutex m
    }
    return 0; // automatically unlock the mutex m
 }
See also:
UMutex

The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Enumerations Friends Defines