diff options
author | Eliot Horowitz <eliot@10gen.com> | 2010-02-09 00:48:02 -0500 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2010-02-09 00:48:02 -0500 |
commit | 76ca6a2887e26f8b9db1a4e399db16d888b1ed64 (patch) | |
tree | 2a3fb12ffefeb9e8377a64f28f2a2fc77590290b /db/db.h | |
parent | eefff3bcc434183574f99a0d77a1baba80e33724 (diff) | |
download | mongo-76ca6a2887e26f8b9db1a4e399db16d888b1ed64.tar.gz |
don't profile if db was closed in interim
Diffstat (limited to 'db/db.h')
-rw-r--r-- | db/db.h | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -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 ){ |