summaryrefslogtreecommitdiff
path: root/db/db.h
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2010-02-09 00:48:02 -0500
committerEliot Horowitz <eliot@10gen.com>2010-02-09 00:48:02 -0500
commit76ca6a2887e26f8b9db1a4e399db16d888b1ed64 (patch)
tree2a3fb12ffefeb9e8377a64f28f2a2fc77590290b /db/db.h
parenteefff3bcc434183574f99a0d77a1baba80e33724 (diff)
downloadmongo-76ca6a2887e26f8b9db1a4e399db16d888b1ed64.tar.gz
don't profile if db was closed in interim
Diffstat (limited to 'db/db.h')
-rw-r--r--db/db.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/db/db.h b/db/db.h
index 917fb5c253b..ddb7507d13a 100644
--- a/db/db.h
+++ b/db/db.h
@@ -48,6 +48,17 @@ namespace mongo {
public:
DatabaseHolder() : _size(0){
}
+
+ bool isLoaded( const string& ns , const string& path ){
+ dbMutex.assertAtLeastReadLocked();
+ map<string,Database*>& m = _paths[path];
+
+ string db = _todb( ns );
+
+ map<string,Database*>::iterator it = m.find(db);
+ return it != m.end();
+ }
+
Database * get( const string& ns , const string& path ){
dbMutex.assertAtLeastReadLocked();
@@ -116,7 +127,7 @@ namespace mongo {
}
}
}
-
+
private:
string _todb( const string& ns ){