fix for legacy dlock test failure sync5.js

This commit is contained in:
gregs
2011-05-05 10:15:34 -04:00
parent 13eb4fc7ad
commit d50efdcbd8

View File

@@ -235,16 +235,22 @@ namespace mongo {
log() << "**** Locked for thread " << threadId << " with ts " << lockObj["ts"] << endl;
if( count % 2 == 1 && ! myLock->lock_try( "Testing lock re-entry.", true ) ) {
errors = true;
log() << "**** !Could not re-enter lock already held" << endl;
break;
}
// Legacy locks are not always guaranteed re-entry since they may not have a valid ping yet,
// but don't use this feature anyway
if( ! legacy ) {
if( count % 2 == 1 && ! myLock->lock_try( "Testing lock re-entry.", true ) ) {
errors = true;
log() << "**** !Could not re-enter lock already held" << endl;
break;
}
if( count % 3 == 1 && myLock->lock_try( "Testing lock non-re-entry.", false ) ) {
errors = true;
log() << "**** !Invalid lock re-entry" << endl;
break;
}
if( count % 3 == 1 && myLock->lock_try( "Testing lock non-re-entry.", false ) ) {
errors = true;
log() << "**** !Invalid lock re-entry" << endl;
break;
}
count++;