EPICS Base  7.0.7.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Public Types | Public Member Functions | List of all members
epicsMutex Class Reference

The C++ API for an epicsMutex.

#include <epicsMutex.h>

Public Types

typedef epicsGuard< epicsMutexguard_t
 
typedef epicsGuard< epicsMutexrelease_t
 

Public Member Functions

 epicsMutex ()
 Create a mutual exclusion semaphore.
 
 epicsMutex (const char *pFileName, int lineno)
 Create a mutual exclusion semaphore with source location. More...
 
 ~epicsMutex ()
 Delete the semaphore and its resources.
 
void show (unsigned level) const
 Display information about the semaphore. More...
 
void lock ()
 Claim the semaphore, waiting until it's free if currently owned owned by a different thread. More...
 
void unlock ()
 Release the semaphore. More...
 
bool tryLock ()
 Similar to lock() except that the call returns immediately if the semaphore is currently owned by another thread, giving the value false. More...
 

Detailed Description

Definition at line 69 of file epicsMutex.h.

Constructor & Destructor Documentation

epicsMutex::epicsMutex ( const char *  pFileName,
int  lineno 
)
Note
The newEpicsMutex macro simplifies using this constructor.
Parameters
*pFileNameSource file name.
linenoSource line number

Member Function Documentation

void epicsMutex::show ( unsigned  level) const
Note
Results are architecture dependent.
Parameters
levelDesired information level to report
void epicsMutex::lock ( )

This call blocks until the calling thread can get exclusive access to the semaphore.

Note
After a successful lock(), additional recursive locks may be issued by the same thread, but each must have an associated unlock().
void epicsMutex::unlock ( )
Note
If a thread issues recursive locks, it must call unlock() as many times as it calls lock().
bool epicsMutex::tryLock ( )
Returns
True if the resource is now owned by the caller.
False if some other thread already owns the resource.

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