PVData C++  8.0.6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | List of all members
epics::pvData::Lock Class Reference

A lock for multithreading. More...

#include <misc/pv/lock.h>

Public Member Functions

 Lock (Mutex &m)
 
 ~Lock ()
 
void lock ()
 
void unlock ()
 
bool tryLock ()
 
bool ownsLock () const
 

Detailed Description

A lock for multithreading.

This is based on item 14 of

Definition at line 36 of file lock.h.

Constructor & Destructor Documentation

epics::pvData::Lock::Lock ( Mutex &  m)
inlineexplicit

Constructor

Parameters
mThe mutex for the facility being locked.

Definition at line 43 of file lock.h.

epics::pvData::Lock::~Lock ( )
inline

Destructor Note that destructor does an automatic unlock.

Definition at line 50 of file lock.h.

Member Function Documentation

void epics::pvData::Lock::lock ( )
inline

Take the lock Recursive locks are supported but each lock must be matched with an unlock.

Definition at line 55 of file lock.h.

bool epics::pvData::Lock::ownsLock ( ) const
inline

See if caller has the lock,

Returns
(false,true) if caller (does not have, has) the lock.

Definition at line 91 of file lock.h.

bool epics::pvData::Lock::tryLock ( )
inline

If lock is not held take the lock.

Returns
(false,true) if caller (does not have, has) the lock.

Definition at line 78 of file lock.h.

void epics::pvData::Lock::unlock ( )
inline

release the lock.

Definition at line 66 of file lock.h.


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