diff options
author | Eliot Horowitz <eliot@10gen.com> | 2012-04-18 16:03:19 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2012-04-18 16:03:19 -0400 |
commit | 1a8d40ea8e2c1045134adf04c4173e88bf4c5257 (patch) | |
tree | 62bc95325e2f1d3c88cd60e9ec1d01d8aa38ab36 /src/mongo/db/d_concurrency.h | |
parent | 09804cb1b1a8ca04824d917b6a58f730bf8efaba (diff) | |
download | mongo-1a8d40ea8e2c1045134adf04c4173e88bf4c5257.tar.gz |
get rid of mongolock
Diffstat (limited to 'src/mongo/db/d_concurrency.h')
-rw-r--r-- | src/mongo/db/d_concurrency.h | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/src/mongo/db/d_concurrency.h b/src/mongo/db/d_concurrency.h index 9d3834018df..0303f16d833 100644 --- a/src/mongo/db/d_concurrency.h +++ b/src/mongo/db/d_concurrency.h @@ -40,15 +40,16 @@ namespace mongo { protected: friend struct TempRelease; ScopedLock(); - virtual ~ScopedLock(); virtual void tempRelease() = 0; virtual void relock() = 0; + public: + virtual ~ScopedLock(); }; // 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 : private ScopedLock { + class GlobalWrite : public ScopedLock { const bool stoppedGreed; bool noop; protected: @@ -65,7 +66,7 @@ namespace mongo { void downgrade(); // W -> R bool upgrade(); // caution see notes }; - class GlobalRead : private ScopedLock { // recursive is ok + class GlobalRead : public ScopedLock { // recursive is ok public: bool noop; protected: @@ -162,21 +163,6 @@ namespace mongo { }; - /** parameterized choice of read or write locking */ - class mongolock { - scoped_ptr<Lock::GlobalRead> r; - scoped_ptr<Lock::GlobalWrite> w; - public: - mongolock(bool write) { - if( write ) { - w.reset( new Lock::GlobalWrite() ); - } - else { - r.reset( new Lock::GlobalRead() ); - } - } - }; - /** a mutex, but reported in curop() - thus a "high level" (HL) one some overhead so we don't use this for everything. the externalobjsort mutex uses this, as it can be held for eons. implementation still needed. */ |