#include <lock.h>
Public Member Functions | |
WithAcquired (Lock &l) | |
Constructs a WithAcquired object by acquiring the given lock. | |
~WithAcquired () | |
The destructor releases the lock. |
This can be used to implement locked sections without catching every possible thing and rethrow it as the destructor is always run, when the closure ends.
WithAcquired::WithAcquired | ( | Lock & | l | ) | [inline] |
Constructs a WithAcquired object by acquiring the given lock.
l | is the lock to be acquired |