![]() |
Storage Engine API
|
Collection lock with support for document-level locking. More...
#include <d_concurrency.h>
Collection lock with support for document-level locking.
This lock supports four modes (see Lock_Mode): MODE_IS: concurrent collection access, requiring document level locking read locks MODE_IX: concurrent collection access, requiring document level read or write locks MODE_S: shared read access to the collection, blocking any writers MODE_X: exclusive access to the collection, blocking all other readers and writers
An appropriate DBLock must already be held before locking a collection: it is an error, checked with a dassert(), to not have a suitable database lock before locking the collection. For storage engines that do not support document-level locking, MODE_IS will be upgraded to MODE_S and MODE_IX will be upgraded to MODE_X.
Public Member Functions | |
CollectionLock (Locker *lockState, StringData ns, LockMode mode, Date_t deadline=Date_t::max()) | |
CollectionLock (CollectionLock &&) | |
~CollectionLock () | |
bool | isLocked () const |
Private Member Functions | |
MONGO_DISALLOW_COPYING (CollectionLock) | |
Private Attributes | |
const ResourceId | _id |
LockResult | _result |
Locker * | _lockState |
mongo::Lock::CollectionLock::CollectionLock | ( | Locker * | lockState, |
StringData | ns, | ||
LockMode | mode, | ||
Date_t | deadline = Date_t::max() |
||
) |
mongo::Lock::CollectionLock::CollectionLock | ( | CollectionLock && | otherLock | ) |
mongo::Lock::CollectionLock::~CollectionLock | ( | ) |
|
inline |
|
private |
|
private |
|
private |
|
private |