diff options
-rw-r--r-- | dbtests/threadedtests.cpp | 2 | ||||
-rw-r--r-- | util/concurrency/rwlock.h | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/dbtests/threadedtests.cpp b/dbtests/threadedtests.cpp index df8d93aa171..0cb04759a8c 100644 --- a/dbtests/threadedtests.cpp +++ b/dbtests/threadedtests.cpp @@ -256,7 +256,7 @@ namespace ThreadedTests { * note: this test will deadlock if the code breaks */ - RWLock lk( "eliot2" , 10000 ); + RWLock lk( "eliot2" , 120 * 1000 ); auto_ptr<rwlock> a( new rwlock( lk , false ) ); diff --git a/util/concurrency/rwlock.h b/util/concurrency/rwlock.h index 5c98a2756ba..9f29e08ef57 100644 --- a/util/concurrency/rwlock.h +++ b/util/concurrency/rwlock.h @@ -288,7 +288,12 @@ namespace mongo { got = true; break; } - sleepmillis(1); + + int sleep = 1; + if ( i > ( lowPriorityWaitMS / 20 ) ) + sleep = 10; + sleepmillis(sleep); + i += ( sleep - 1 ); } if ( ! got ) { log() << "couldn't get lazy rwlock" << endl; |