diff options
Diffstat (limited to 'db/client.cpp')
-rw-r--r-- | db/client.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/db/client.cpp b/db/client.cpp index 1447ab49da0..a7d068453a4 100644 --- a/db/client.cpp +++ b/db/client.cpp @@ -114,6 +114,13 @@ namespace mongo { _db = dbHolder.getOrCreate( _ns , _path , _justCreated ); assert( _db ); } + else if ( dbMutex.getState() < -1 ){ + // nested read lock :( + assert( _lock ); + _lock->releaseAndWriteLock(); + _db = dbHolder.getOrCreate( _ns , _path , _justCreated ); + assert( _db ); + } else { // we have a read lock, but need to get a write lock for a bit // we need to be in a write lock since we're going to create the DB object |