diff options
author | Andy Schwerin <schwerin@mongodb.com> | 2015-02-27 18:33:28 -0500 |
---|---|---|
committer | Andy Schwerin <schwerin@mongodb.com> | 2015-03-12 17:11:20 -0400 |
commit | 7cd9cf303c824478f0f6d60cadfcc1a25bdb21f2 (patch) | |
tree | ebeec8c3c2dc21359b941d95e2109e355542e65f /src/mongo/util/concurrency/mutex.h | |
parent | 7ee3d124070db157181bc1b24f2b84913957c388 (diff) | |
download | mongo-7cd9cf303c824478f0f6d60cadfcc1a25bdb21f2.tar.gz |
SERVER-17310 Make mongo::mutex a typedef of boost::mutex and remove mongo::scoped_lock.
Diffstat (limited to 'src/mongo/util/concurrency/mutex.h')
-rw-r--r-- | src/mongo/util/concurrency/mutex.h | 40 |
1 files changed, 1 insertions, 39 deletions
diff --git a/src/mongo/util/concurrency/mutex.h b/src/mongo/util/concurrency/mutex.h index 67eb565c37d..5e207e7662b 100644 --- a/src/mongo/util/concurrency/mutex.h +++ b/src/mongo/util/concurrency/mutex.h @@ -75,45 +75,7 @@ namespace mongo { ~StaticObserver() { _destroyingStatics = true; } }; - /** On pthread systems, it is an error to destroy a mutex while held (boost mutex - * may use pthread). Static global mutexes may be held upon shutdown in our - * implementation, and this way we avoid destroying them. - * NOT recursive. - */ - class mutex : boost::noncopyable { - public: - const char * const _name; - // NOINLINE so that 'mutex::mutex' is always in the frame, this makes - // it easier for us to suppress the leaks caused by the static observer. - NOINLINE_DECL mutex(const char *name) : _name(name) - { - _m = new boost::timed_mutex(); - IGNORE_OBJECT( _m ); // Turn-off heap checking on _m - } - ~mutex() { - if( !StaticObserver::_destroyingStatics ) { - UNIGNORE_OBJECT( _m ); - delete _m; - } - } - - class scoped_lock : boost::noncopyable { - public: - scoped_lock( mongo::mutex &m ) : - _l( m.boost() ) { - } - ~scoped_lock() { - } - boost::unique_lock<boost::timed_mutex>& boost() { return _l; } - private: - boost::unique_lock<boost::timed_mutex> _l; - }; - private: - boost::timed_mutex &boost() { return *_m; } - boost::timed_mutex *_m; - }; - - typedef mongo::mutex::scoped_lock scoped_lock; + using mutex = boost::mutex; /** The concept with SimpleMutex is that it is a basic lock/unlock with no special functionality (such as try and try timeout). Thus it can be |