diff options
author | Andrew Morrow <acm@mongodb.com> | 2015-06-18 15:02:54 -0400 |
---|---|---|
committer | Andrew Morrow <acm@mongodb.com> | 2015-06-19 22:51:28 -0400 |
commit | 1178eff1ddf60a7dac3a8cd71e2fdd278aa01b52 (patch) | |
tree | ee3096045eb4d2e4f69d57ef85c66b3be69e4302 /src/mongo/dbtests | |
parent | 4b5fa5fc711e4cf94291665575fd1c742ad3e7c3 (diff) | |
download | mongo-1178eff1ddf60a7dac3a8cd71e2fdd278aa01b52.tar.gz |
SERVER-19041 Simplify SimpleMutex
Diffstat (limited to 'src/mongo/dbtests')
-rw-r--r-- | src/mongo/dbtests/dbtests.cpp | 1 | ||||
-rw-r--r-- | src/mongo/dbtests/documentsourcetests.cpp | 2 | ||||
-rw-r--r-- | src/mongo/dbtests/framework.cpp | 4 | ||||
-rw-r--r-- | src/mongo/dbtests/mock/mock_conn_registry.h | 2 | ||||
-rw-r--r-- | src/mongo/dbtests/perftests.cpp | 4 | ||||
-rw-r--r-- | src/mongo/dbtests/threadedtests.cpp | 6 |
6 files changed, 10 insertions, 9 deletions
diff --git a/src/mongo/dbtests/dbtests.cpp b/src/mongo/dbtests/dbtests.cpp index c6727922ae6..f094709d471 100644 --- a/src/mongo/dbtests/dbtests.cpp +++ b/src/mongo/dbtests/dbtests.cpp @@ -48,6 +48,7 @@ #include "mongo/util/quick_exit.h" #include "mongo/util/signal_handlers_synchronous.h" #include "mongo/util/startup_test.h" +#include "mongo/util/static_observer.h" #include "mongo/util/text.h" namespace mongo { diff --git a/src/mongo/dbtests/documentsourcetests.cpp b/src/mongo/dbtests/documentsourcetests.cpp index e31ab3aa0e0..7eff2147b44 100644 --- a/src/mongo/dbtests/documentsourcetests.cpp +++ b/src/mongo/dbtests/documentsourcetests.cpp @@ -298,7 +298,7 @@ namespace DocumentSourceTests { } private: int _value; - mutable mongo::mutex _mutex; + mutable stdx::mutex _mutex; mutable stdx::condition_variable _condition; }; diff --git a/src/mongo/dbtests/framework.cpp b/src/mongo/dbtests/framework.cpp index dab30d47f74..d91e7012cea 100644 --- a/src/mongo/dbtests/framework.cpp +++ b/src/mongo/dbtests/framework.cpp @@ -50,9 +50,9 @@ #include "mongo/s/d_state.h" #include "mongo/s/grid.h" #include "mongo/s/catalog/legacy/legacy_dist_lock_manager.h" +#include "mongo/stdx/mutex.h" #include "mongo/util/assert_util.h" #include "mongo/util/background.h" -#include "mongo/util/concurrency/mutex.h" #include "mongo/util/exit.h" #include "mongo/util/log.h" #include "mongo/util/version.h" @@ -66,7 +66,7 @@ namespace mongo { namespace dbtests { - mutex globalCurrentTestNameMutex; + stdx::mutex globalCurrentTestNameMutex; std::string globalCurrentTestName; class TestWatchDog : public BackgroundJob { diff --git a/src/mongo/dbtests/mock/mock_conn_registry.h b/src/mongo/dbtests/mock/mock_conn_registry.h index a4177ae5592..6822df4b57e 100644 --- a/src/mongo/dbtests/mock/mock_conn_registry.h +++ b/src/mongo/dbtests/mock/mock_conn_registry.h @@ -115,7 +115,7 @@ namespace mongo { MockConnHook _mockConnStrHook; // protects _registry - mongo::mutex _registryMutex; + stdx::mutex _registryMutex; unordered_map<std::string, MockRemoteDBServer*> _registry; }; } diff --git a/src/mongo/dbtests/perftests.cpp b/src/mongo/dbtests/perftests.cpp index 8eec55fe913..ba0004926b7 100644 --- a/src/mongo/dbtests/perftests.cpp +++ b/src/mongo/dbtests/perftests.cpp @@ -536,7 +536,7 @@ namespace PerfTests { #endif RWLock lk("testrw"); - SimpleMutex m("simptst"); + SimpleMutex m; boost::mutex mboost; boost::timed_mutex mboost_timed; std::mutex mstd; @@ -577,7 +577,7 @@ namespace PerfTests { virtual int howLongMillis() { return 500; } virtual bool showDurStats() { return false; } void timed() { - SimpleMutex::scoped_lock lk(m); + stdx::lock_guard<SimpleMutex> lk(m); } }; diff --git a/src/mongo/dbtests/threadedtests.cpp b/src/mongo/dbtests/threadedtests.cpp index 4f714dd4a10..e8af4c8fdd5 100644 --- a/src/mongo/dbtests/threadedtests.cpp +++ b/src/mongo/dbtests/threadedtests.cpp @@ -591,7 +591,7 @@ namespace ThreadedTests { template <class whichmutex, class scoped> class Slack : public ThreadedTest<17> { public: - Slack() : m("slack") { + Slack() { k = 0; done = false; a = b = 0; @@ -769,7 +769,7 @@ namespace ThreadedTests { verify( _checkedIn >= 0 ); } - mongo::mutex _frontDesk; + stdx::mutex _frontDesk; int _nRooms; int _checkedIn; int _maxRooms; @@ -821,7 +821,7 @@ namespace ThreadedTests { // Slack is a test to see how long it takes for another thread to pick up // and begin work after another relinquishes the lock. e.g. a spin lock // would have very little slack. - add< Slack<SimpleMutex,SimpleMutex::scoped_lock> >(); + add< Slack<SimpleMutex,stdx::lock_guard<SimpleMutex>> >(); add< Slack<SimpleRWLock,SimpleRWLock::Exclusive> >(); add< CondSlack >(); |