CARMA C++
|
A templated scope class (i.e. More...
#include <carma/util/ScopedExclusiveLock.h>
Public Member Functions | |
ScopedExclusiveLock (L &l) | |
Obtains an exclusive lock on the given lock for the caller's thread (possibly waiting an indeterminate amount of time along the way). More... | |
~ScopedExclusiveLock () | |
Releases the exclusive lock on the lock (that was given to the constructor) held by the caller's thread. More... | |
A templated scope class (i.e.
a class that does or manages something for the lifetime of the instance) that makes simple lock management easier in a C++ world.
Typical usage would look something like this:
If your locking needs are not so simple then ScopedExclusiveLockManager< L > might be what you need.
Definition at line 45 of file ScopedExclusiveLock.h.
|
explicit |
Obtains an exclusive lock on the given lock for the caller's thread (possibly waiting an indeterminate amount of time along the way).
l | The lock to to wait for an exclusive lock on |
Definition at line 79 of file ScopedExclusiveLock.h.
carma::util::ScopedExclusiveLock< L >::~ScopedExclusiveLock | ( | ) |
Releases the exclusive lock on the lock (that was given to the constructor) held by the caller's thread.
Definition at line 87 of file ScopedExclusiveLock.h.