CARMA C++
|
A templated scope class (i.e. More...
#include <carma/util/ScopedLock.h>
Public Member Functions | |
ScopedLock (M &m) | |
Obtains a lock on the given mutex for the caller's thread (possibly waiting an indeterminate amount of time along the way). More... | |
~ScopedLock () | |
Releases the lock on the mutex (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 mutex lock management easier in a C++ world.
Typical usage would look something like this:
If your locking needs are not so simple then ScopedLockManager< M > might be what you need.
Definition at line 46 of file ScopedLock.h.
|
explicit |
Obtains a lock on the given mutex for the caller's thread (possibly waiting an indeterminate amount of time along the way).
m | The mutex to to wait for a lock on |
Definition at line 79 of file ScopedLock.h.
carma::util::ScopedLock< M >::~ScopedLock | ( | ) |
Releases the lock on the mutex (that was given to the constructor) held by the caller's thread.
Definition at line 88 of file ScopedLock.h.