Notfication callback, which stores the last notification result and signals a condition variable, which can be waited on.
More...
#include <lock_state.h>
Notfication callback, which stores the last notification result and signals a condition variable, which can be waited on.
◆ CondVarLockGrantNotification()
mongo::CondVarLockGrantNotification::CondVarLockGrantNotification |
( |
| ) |
|
◆ clear()
void mongo::CondVarLockGrantNotification::clear |
( |
| ) |
|
Clears the object so it can be reused.
◆ MONGO_DISALLOW_COPYING()
◆ notify()
This method is invoked at most once for each lock request and indicates the outcome of the lock acquisition for the specified resource id.
Cases where it won't be called are if a lock acquisition (be it in waiting or converting state) is cancelled through a call to unlock.
IMPORTANT: This callback runs under a spinlock for the lock manager, so the work done inside must be kept to a minimum and no locks or operations which may block should be run. Also, no methods which call back into the lock manager should be invoked from within this methods (LockManager is not reentrant).
ResourceId for which a lock operation was previously called.
- Returns
- Outcome of the lock operation.
Implements mongo::LockGrantNotification.
◆ wait() [1/2]
LockResult mongo::CondVarLockGrantNotification::wait |
( |
Milliseconds |
timeout | ) |
|
Uninterruptible blocking method, which waits for the notification to fire.
- Parameters
-
timeout | How many milliseconds to wait before returning LOCK_TIMEOUT. |
◆ wait() [2/2]
LockResult mongo::CondVarLockGrantNotification::wait |
( |
OperationContext * |
opCtx, |
|
|
Milliseconds |
timeout |
|
) |
| |
Interruptible blocking method, which waits for the notification to fire or an interrupt from the operation context.
- Parameters
-
opCtx | OperationContext to wait on for an interrupt. |
timeout | How many milliseconds to wait before returning LOCK_TIMEOUT. |
◆ _cond
stdx::condition_variable mongo::CondVarLockGrantNotification::_cond |
|
private |
◆ _mutex
stdx::mutex mongo::CondVarLockGrantNotification::_mutex |
|
private |
◆ _result
LockResult mongo::CondVarLockGrantNotification::_result |
|
private |
The documentation for this class was generated from the following files:
- /home/louis/git/mongodbsource.github.io/src/src/mongo/db/concurrency/lock_state.h
- /home/louis/git/mongodbsource.github.io/src/src/mongo/db/concurrency/lock_state.cpp