|
lcls2
C++ API: public headers of xtcdata, psalg, psdaq and psana
|
Abstract lock on a binary Semaphore (the VxWorks variant is not supported). More...
#include <Lock.hh>
Public Member Functions | |
| Lock (unsigned retries) | |
| Create the lock free (semaphore full) and keep the retry count retries. | |
| void | release () |
| Release the lock (give the semaphore). | |
| void | get () |
| Take the lock, blocking on the semaphore. | |
| virtual void | cantLock ()=0 |
| Pure virtual: meant to be called when the lock cannot be obtained after the retries. | |
| virtual | ~Lock () |
| Does nothing; empty virtual destructor. | |
Abstract lock on a binary Semaphore (the VxWorks variant is not supported).
Subclasses implement cantLock().
| Pds::Lock::Lock | ( | unsigned | retries | ) |
Create the lock free (semaphore full) and keep the retry count retries.
|
inlinevirtual |
Does nothing; empty virtual destructor.
|
pure virtual |
Pure virtual: meant to be called when the lock cannot be obtained after the retries.
| void Pds::Lock::get | ( | ) |
Take the lock, blocking on the semaphore.
On non-VxWorks builds the retry loop and cantLock() are never reached, because each attempt blocks until it succeeds.
| void Pds::Lock::release | ( | ) |
Release the lock (give the semaphore).