diff --git a/db/client.h b/db/client.h index 44db4b49680..030a2cb7b91 100644 --- a/db/client.h +++ b/db/client.h @@ -120,15 +120,16 @@ namespace mongo { /* this unlocks, does NOT upgrade. that works for our current usage */ inline void mongolock::releaseAndWriteLock() { + if( !_writelock ) { + #if BOOST_VERSION >= 103500 - int s = dbMutex.getState(); - if( s != -1 ) { - log() << "error: releaseAndWriteLock() s == " << s << endl; - msgasserted( "releaseAndWriteLock: unlock_shared failed, probably recursive" ); - } + int s = dbMutex.getState(); + if( s != -1 ) { + log() << "error: releaseAndWriteLock() s == " << s << endl; + msgasserted( "releaseAndWriteLock: unlock_shared failed, probably recursive" ); + } #endif - if( !_writelock ) { _writelock = true; dbMutex.unlock_shared(); dbMutex.lock();