summaryrefslogtreecommitdiff
path: root/dbtests
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2011-01-05 00:32:30 -0500
committerEliot Horowitz <eliot@10gen.com>2011-01-05 00:32:30 -0500
commit19f1a2c184c16c950de48489d3ada5f5675bd3c3 (patch)
tree97ae5c0736afeff6d6853c156e524bed95d1df5c /dbtests
parent4b80354d2fdf18d187673631cee3755000784be8 (diff)
downloadmongo-19f1a2c184c16c950de48489d3ada5f5675bd3c3.tar.gz
astyle
Diffstat (limited to 'dbtests')
-rw-r--r--dbtests/threadedtests.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/dbtests/threadedtests.cpp b/dbtests/threadedtests.cpp
index 8eeec6b7f45..bf0c96f199a 100644
--- a/dbtests/threadedtests.cpp
+++ b/dbtests/threadedtests.cpp
@@ -57,64 +57,64 @@ namespace ThreadedTests {
}
};
- class MongoMutexTest : public ThreadedTest<135> {
+ class MongoMutexTest : public ThreadedTest<135> {
enum { N = 100000 };
MongoMutex *mm;
- virtual void setup() {
+ virtual void setup() {
mm = new MongoMutex("MongoMutexTest");
}
- virtual void subthread() {
+ virtual void subthread() {
Client::initThread("mongomutextest");
sleepmillis(0);
- for( int i = 0; i < N; i++ ) {
- if( i % 20000 == 0 )
+ for( int i = 0; i < N; i++ ) {
+ if( i % 20000 == 0 )
log() << i << endl;
- if( i % 7 == 0 ) {
+ if( i % 7 == 0 ) {
mm->lock_shared();
mm->lock_shared();
mm->unlock_shared();
mm->unlock_shared();
}
- else if( i % 7 == 1 ) {
+ else if( i % 7 == 1 ) {
mm->lock_shared();
ASSERT( mm->atLeastReadLocked() );
mm->unlock_shared();
}
- else if( i % 7 == 2 ) {
+ else if( i % 7 == 2 ) {
mm->lock();
ASSERT( mm->isWriteLocked() );
mm->unlock();
}
- else if( i % 7 == 3 ) {
+ else if( i % 7 == 3 ) {
mm->lock();
mm->lock_shared();
ASSERT( mm->isWriteLocked() );
mm->unlock_shared();
mm->unlock();
}
- else if( i % 7 == 4 ) {
+ else if( i % 7 == 4 ) {
mm->lock();
mm->releaseEarly();
mm->unlock();
}
- else if( i % 7 == 5 ) {
- if( mm->lock_try(1) ) {
+ else if( i % 7 == 5 ) {
+ if( mm->lock_try(1) ) {
mm->unlock();
}
}
- else if( i % 7 == 6 ) {
- if( mm->lock_shared_try(0) ) {
+ else if( i % 7 == 6 ) {
+ if( mm->lock_shared_try(0) ) {
mm->unlock_shared();
}
}
- else {
+ else {
mm->lock_shared();
mm->unlock_shared();
}
}
cc().shutdown();
}
- virtual void validate() {
+ virtual void validate() {
ASSERT( !mm->atLeastReadLocked() );
mm->lock();
mm->unlock();