diff options
Diffstat (limited to 'src/mongo/db/storage/wiredtiger/wiredtiger_size_storer.cpp')
-rw-r--r-- | src/mongo/db/storage/wiredtiger/wiredtiger_size_storer.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_size_storer.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_size_storer.cpp index 20f177c05fd..8d61fb17712 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_size_storer.cpp +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_size_storer.cpp @@ -70,7 +70,7 @@ namespace mongo { WiredTigerSizeStorer::~WiredTigerSizeStorer() { // This shouldn't be necessary, but protects us if we screw up. - boost::mutex::scoped_lock cursorLock( _cursorMutex ); + boost::lock_guard<boost::mutex> cursorLock( _cursorMutex ); _magic = 11111; _cursor->close(_cursor); @@ -86,7 +86,7 @@ namespace mongo { void WiredTigerSizeStorer::onCreate( WiredTigerRecordStore* rs, long long numRecords, long long dataSize ) { _checkMagic(); - boost::mutex::scoped_lock lk( _entriesMutex ); + boost::lock_guard<boost::mutex> lk( _entriesMutex ); Entry& entry = _entries[rs->getURI()]; entry.rs = rs; entry.numRecords = numRecords; @@ -96,7 +96,7 @@ namespace mongo { void WiredTigerSizeStorer::onDestroy( WiredTigerRecordStore* rs ) { _checkMagic(); - boost::mutex::scoped_lock lk( _entriesMutex ); + boost::lock_guard<boost::mutex> lk( _entriesMutex ); Entry& entry = _entries[rs->getURI()]; entry.numRecords = rs->numRecords( NULL ); entry.dataSize = rs->dataSize( NULL ); @@ -108,7 +108,7 @@ namespace mongo { void WiredTigerSizeStorer::storeToCache( StringData uri, long long numRecords, long long dataSize ) { _checkMagic(); - boost::mutex::scoped_lock lk( _entriesMutex ); + boost::lock_guard<boost::mutex> lk( _entriesMutex ); Entry& entry = _entries[uri.toString()]; entry.numRecords = numRecords; entry.dataSize = dataSize; @@ -118,7 +118,7 @@ namespace mongo { void WiredTigerSizeStorer::loadFromCache( StringData uri, long long* numRecords, long long* dataSize ) const { _checkMagic(); - boost::mutex::scoped_lock lk( _entriesMutex ); + boost::lock_guard<boost::mutex> lk( _entriesMutex ); Map::const_iterator it = _entries.find( uri.toString() ); if ( it == _entries.end() ) { *numRecords = 0; @@ -130,7 +130,7 @@ namespace mongo { } void WiredTigerSizeStorer::fillCache() { - boost::mutex::scoped_lock cursorLock( _cursorMutex ); + boost::lock_guard<boost::mutex> cursorLock( _cursorMutex ); _checkMagic(); Map m; @@ -162,17 +162,17 @@ namespace mongo { } } - boost::mutex::scoped_lock lk( _entriesMutex ); + boost::lock_guard<boost::mutex> lk( _entriesMutex ); _entries.swap(m); } void WiredTigerSizeStorer::syncCache(bool syncToDisk) { - boost::mutex::scoped_lock cursorLock( _cursorMutex ); + boost::lock_guard<boost::mutex> cursorLock( _cursorMutex ); _checkMagic(); Map myMap; { - boost::mutex::scoped_lock lk( _entriesMutex ); + boost::lock_guard<boost::mutex> lk( _entriesMutex ); for ( Map::iterator it = _entries.begin(); it != _entries.end(); ++it ) { std::string uriKey = it->first; Entry& entry = it->second; @@ -227,7 +227,7 @@ namespace mongo { invariantWTOK(session->commit_transaction(session, NULL)); { - boost::mutex::scoped_lock lk( _entriesMutex ); + boost::lock_guard<boost::mutex> lk( _entriesMutex ); for (Map::iterator it = _entries.begin(); it != _entries.end(); ++it) { it->second.dirty = false; } |