MongoDB  2.0.3
Public Member Functions
mongo::Guarded< T, BY > Class Template Reference

declare that a variable that is "guarded" by a mutex. More...

#include <value.h>

List of all members.

Public Member Functions

T & ref (const scoped_lock &lk)

Detailed Description

template<typename T, mutex & BY>
class mongo::Guarded< T, BY >

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.


The documentation for this class was generated from the following file: