SERVER-695 don't destroy static global mutexes

This commit is contained in:
Aaron
2010-03-09 23:59:10 -08:00
parent c4b55b2957
commit 714ec2fdc8
50 changed files with 204 additions and 153 deletions

View File

@@ -220,7 +220,7 @@ namespace mongo {
void QueryPlan::registerSelf( long long nScanned ) const {
if ( fbs_.matchPossible() ) {
boostlock lk(NamespaceDetailsTransient::_qcMutex);
scoped_lock lk(NamespaceDetailsTransient::_qcMutex);
NamespaceDetailsTransient::get_inlock( ns() ).registerIndexForPattern( fbs_.pattern( order_ ), indexKey(), nScanned );
}
}
@@ -340,7 +340,7 @@ namespace mongo {
}
if ( honorRecordedPlan_ ) {
boostlock lk(NamespaceDetailsTransient::_qcMutex);
scoped_lock lk(NamespaceDetailsTransient::_qcMutex);
NamespaceDetailsTransient& nsd = NamespaceDetailsTransient::get_inlock( ns );
BSONObj bestIndex = nsd.indexForPattern( fbs_.pattern( order_ ) );
if ( !bestIndex.isEmpty() ) {
@@ -419,7 +419,7 @@ namespace mongo {
if ( res->complete() || plans_.size() > 1 )
return res;
{
boostlock lk(NamespaceDetailsTransient::_qcMutex);
scoped_lock lk(NamespaceDetailsTransient::_qcMutex);
NamespaceDetailsTransient::get_inlock( fbs_.ns() ).registerIndexForPattern( fbs_.pattern( order_ ), BSONObj(), 0 );
}
init();