diff options
author | Eliot Horowitz <eliot@10gen.com> | 2012-04-25 15:33:59 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2012-05-07 10:35:36 -0400 |
commit | e322222f11d715fb66b9bf9f7b43f7fad244dace (patch) | |
tree | f539bb84034fe8b96d96439a8c1206228a13659d /src/mongo/db/d_concurrency.h | |
parent | 94559111b0c2e754bb9b16863de8f96fff83819e (diff) | |
download | mongo-e322222f11d715fb66b9bf9f7b43f7fad244dace.tar.gz |
little bit of cleaning for Lock::DB(Write|Read)
Diffstat (limited to 'src/mongo/db/d_concurrency.h')
-rw-r--r-- | src/mongo/db/d_concurrency.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/mongo/db/d_concurrency.h b/src/mongo/db/d_concurrency.h index 3ce97e58104..b82b62ae88e 100644 --- a/src/mongo/db/d_concurrency.h +++ b/src/mongo/db/d_concurrency.h @@ -54,7 +54,7 @@ namespace mongo { // note that for these classes recursive locking is ok if the recursive locking "makes sense" // i.e. you could grab globalread after globalwrite. - + class GlobalWrite : public ScopedLock { bool stoppedGreed; bool noop; @@ -85,7 +85,6 @@ namespace mongo { }; // lock this database. do not shared_lock globally first, that is handledin herein. class DBWrite : public ScopedLock { - bool isW(LockState&) const; void lockTop(LockState&); void lockNestable(Nestable db); void lockOther(const string& db); @@ -110,7 +109,6 @@ namespace mongo { }; // lock this database for reading. do not shared_lock globally first, that is handledin herein. class DBRead : public ScopedLock { - bool isRW(LockState&) const; void lockTop(LockState&); void lockNestable(Nestable db); void lockOther(const string& db); @@ -178,6 +176,13 @@ namespace mongo { */ char threadState() const { return _threadState; } + bool isRW() const; + bool isW() const; + bool hasAnyReadLock() const; + + // ---- + + void locked( char newState ); // RWrw void unlocked(); // _threadState = 0 |