cgma
CubitConcurrent::MutexLocker Struct Reference

#include <CubitConcurrentApi.h>

List of all members.

Public Member Functions

 MutexLocker (Mutex *mutex)
 ~MutexLocker ()
void lock ()
void unlock ()

Public Attributes

MutexmMutex
bool mLocked

Detailed Description

Definition at line 38 of file CubitConcurrentApi.h.


Constructor & Destructor Documentation

Definition at line 40 of file CubitConcurrentApi.h.

                              : mMutex(mutex), mLocked(false)
    {
      lock();
    }

Definition at line 44 of file CubitConcurrentApi.h.

    {
      unlock();
    }

Member Function Documentation

Definition at line 48 of file CubitConcurrentApi.h.

    {
      if(!mLocked)
      {
        mMutex->lock();
        mLocked = true;
      }
    }

Definition at line 56 of file CubitConcurrentApi.h.

    {
      if(mLocked)
      {
        mMutex->unlock();
        mLocked = false;
      }
    }

Member Data Documentation


The documentation for this struct was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines