summaryrefslogtreecommitdiff
path: root/dbtests/threadedtests.cpp
diff options
context:
space:
mode:
authorAntonin Kral <a.kral@bobek.cz>2010-08-11 12:38:57 +0200
committerAntonin Kral <a.kral@bobek.cz>2010-08-11 12:38:57 +0200
commit7645618fd3914cb8a20561625913c20d49504a49 (patch)
tree8370f846f58f6d71165b7a0e2eda04648584ec76 /dbtests/threadedtests.cpp
parent68c73c3c7608b4c87f07440dc3232801720b1168 (diff)
downloadmongodb-7645618fd3914cb8a20561625913c20d49504a49.tar.gz
Imported Upstream version 1.6.0
Diffstat (limited to 'dbtests/threadedtests.cpp')
-rw-r--r--dbtests/threadedtests.cpp23
1 files changed, 19 insertions, 4 deletions
diff --git a/dbtests/threadedtests.cpp b/dbtests/threadedtests.cpp
index 2ffafba..af413cc 100644
--- a/dbtests/threadedtests.cpp
+++ b/dbtests/threadedtests.cpp
@@ -17,10 +17,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "stdafx.h"
-#include "../util/atomic_int.h"
-#include "../util/mvar.h"
-#include "../util/thread_pool.h"
+#include "pch.h"
+#include "../bson/util/atomic_int.h"
+#include "../util/concurrency/mvar.h"
+#include "../util/concurrency/thread_pool.h"
#include <boost/thread.hpp>
#include <boost/bind.hpp>
@@ -129,6 +129,20 @@ namespace ThreadedTests {
}
};
+ class LockTest {
+ public:
+ void run(){
+ // quick atomicint wrap test
+ // MSGID likely assumes this semantic
+ AtomicUInt counter = 0xffffffff;
+ counter++;
+ ASSERT( counter == 0 );
+
+ writelocktry lk( "" , 0 );
+ ASSERT( lk.got() );
+ }
+ };
+
class All : public Suite {
public:
All() : Suite( "threading" ){
@@ -138,6 +152,7 @@ namespace ThreadedTests {
add< IsAtomicUIntAtomic >();
add< MVarTest >();
add< ThreadPoolTest >();
+ add< LockTest >();
}
} myall;
}