|
MongoDB
2.0.3
|
declare that a variable that is "guarded" by a mutex. More...
#include <value.h>
Public Member Functions | |
| T & | ref (const scoped_lock &lk) |
declare that a variable that is "guarded" by a mutex.
The decl documents the rule. For example "counta and countb are guarded by xyzMutex":
Guarded<int, xyzMutex> counta; Guarded<int, xyzMutex> countb;
Upon use, specify the scoped_lock object. This makes it hard for someone later to forget to be in the lock. Check is made that it is the right lock in _DEBUG builds at runtime.
1.8.0