diff options
author | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2016-06-08 17:13:49 -0400 |
---|---|---|
committer | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2016-06-10 18:00:48 -0400 |
commit | 9d7981ac25bae25c7764c44eb6bd58942a1aae43 (patch) | |
tree | 2658a7fb2b7199377d04a2a5f8f19c788380e8e3 /src/mongo/dbtests/threadedtests.cpp | |
parent | 029938758e4f9c7079e2363bf5e56c1452c20426 (diff) | |
download | mongo-9d7981ac25bae25c7764c44eb6bd58942a1aae43.tar.gz |
SERVER-24479 Make 'Notification' class be able to return a value
Diffstat (limited to 'src/mongo/dbtests/threadedtests.cpp')
-rw-r--r-- | src/mongo/dbtests/threadedtests.cpp | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/src/mongo/dbtests/threadedtests.cpp b/src/mongo/dbtests/threadedtests.cpp index 5ab410361eb..d2f8c4a7ea4 100644 --- a/src/mongo/dbtests/threadedtests.cpp +++ b/src/mongo/dbtests/threadedtests.cpp @@ -49,7 +49,6 @@ #include "mongo/util/concurrency/old_thread_pool.h" #include "mongo/util/concurrency/old_thread_pool.h" #include "mongo/util/concurrency/rwlock.h" -#include "mongo/util/concurrency/synchronization.h" #include "mongo/util/concurrency/ticketholder.h" #include "mongo/util/log.h" #include "mongo/util/timer.h" @@ -610,59 +609,6 @@ private: } }; -class CondSlack : public ThreadedTest<17> { - Notification n; - -public: - CondSlack() { - k = 0; - done = false; - a = b = 0; - locks = 0; - } - -private: - unsigned a, b; - virtual void validate() { - cout << "CondSlack useful work fraction: " << ((double)a) / b << " locks:" << locks << endl; - } - unsigned locks; - volatile int k; - void watch() { - while (1) { - b++; - if (k) { - a++; - } - sleepmillis(0); - if (done) - break; - } - } - volatile bool done; - virtual void subthread(int x) { - if (x == 1) { - n.notifyOne(); - watch(); - return; - } - Timer t; - while (1) { - n.waitToBeNotified(); - verify(k == 0); - k = 1; - // not very long, we'd like to simulate about 100K locks per second - sleepalittle(); - k = 0; - locks++; - n.notifyOne(); - if (done || t.millis() > 1500) - break; - } - done = true; - } -}; - const int WriteLocksAreGreedy_ThreadCount = 3; class WriteLocksAreGreedy : public ThreadedTest<WriteLocksAreGreedy_ThreadCount> { public: @@ -778,7 +724,6 @@ public: // would have very little slack. add<Slack<SimpleMutex, stdx::lock_guard<SimpleMutex>>>(); add<Slack<SimpleRWLock, SimpleRWLock::Exclusive>>(); - add<CondSlack>(); add<UpgradableTest>(); |