Storage Engine API
global_lock_acquisition_tracker.h
Go to the documentation of this file.
1 
29 #pragma once
30 
31 #include "mongo/db/operation_context.h"
32 
33 namespace mongo {
34 
41 public:
42  static const OperationContext::Decoration<GlobalLockAcquisitionTracker> get;
43 
44  // Decoration requires a default constructor.
45  GlobalLockAcquisitionTracker() = default;
46 
50  bool getGlobalExclusiveLockTaken() const;
51 
56 
57 private:
58  // Set to true when the global lock is first taken in X or IX mode. Never set back to false.
60 };
61 
62 } // namespace mongo
bool getGlobalExclusiveLockTaken() const
Returns whether we have ever taken a global lock in X or IX mode in this operation.
Definition: global_lock_acquisition_tracker.cpp:38
bool _globalExclusiveLockTaken
Definition: global_lock_acquisition_tracker.h:59
Copyright (C) 2014 MongoDB Inc.
Definition: bson_collection_catalog_entry.cpp:38
void setGlobalExclusiveLockTaken()
Sets that we have ever taken a global lock in X or IX mode in this operation.
Definition: global_lock_acquisition_tracker.cpp:42
The GlobalLockAcquisitionTracker keeps track of if the global lock has ever been taken in X or IX mod...
Definition: global_lock_acquisition_tracker.h:40