diff options
author | Eliot Horowitz <eliot@10gen.com> | 2012-04-24 11:50:27 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2012-04-24 15:41:24 -0400 |
commit | f1eced224de959059275ff814fe1215845ac5b27 (patch) | |
tree | 5f72a722e914ca40f99351f0c80964b7c69577c6 /src/mongo/db | |
parent | a486732a251c80b4df9a04be3ef0ef34e7167e3b (diff) | |
download | mongo-f1eced224de959059275ff814fe1215845ac5b27.tar.gz |
get rid of readlocktryassert
Diffstat (limited to 'src/mongo/db')
-rw-r--r-- | src/mongo/db/d_concurrency.h | 8 | ||||
-rw-r--r-- | src/mongo/db/restapi.cpp | 9 |
2 files changed, 6 insertions, 11 deletions
diff --git a/src/mongo/db/d_concurrency.h b/src/mongo/db/d_concurrency.h index 285653d9356..4213f4be4f7 100644 --- a/src/mongo/db/d_concurrency.h +++ b/src/mongo/db/d_concurrency.h @@ -143,14 +143,6 @@ namespace mongo { bool got() const { return _got; } }; - struct readlocktryassert : public readlocktry { - readlocktryassert(int tryms) : - readlocktry(tryms) { - uassert(13142, "timeout getting readlock", got()); - } - }; - - /** a mutex, but reported in curop() - thus a "high level" (HL) one some overhead so we don't use this for everything. the externalobjsort mutex uses this, as it can be held for eons. implementation still needed. */ diff --git a/src/mongo/db/restapi.cpp b/src/mongo/db/restapi.cpp index 560dbce97c5..0f982b5fda8 100644 --- a/src/mongo/db/restapi.cpp +++ b/src/mongo/db/restapi.cpp @@ -237,7 +237,8 @@ namespace mongo { void openAdminDb() { { - readlocktryassert rl(/*"admin.system.users", */10000); + readlocktry rl(/*"admin.system.users", */10000); + uassert( 16172 , "couldn't get readlock to open admin db" , rl.got() ); if( dbHolder().get("admin.system.users",dbpath) ) return; } @@ -249,7 +250,8 @@ namespace mongo { bool RestAdminAccess::haveAdminUsers() const { openAdminDb(); - readlocktryassert rl(/*"admin.system.users", */10000); + readlocktry rl(/*"admin.system.users", */10000); + uassert( 16173 , "couldn't get read lock to get admin auth credentials" , rl.got() ); Client::Context cx( "admin.system.users", dbpath, false ); return ! Helpers::isEmpty("admin.system.users", false); } @@ -257,7 +259,8 @@ namespace mongo { BSONObj RestAdminAccess::getAdminUser( const string& username ) const { openAdminDb(); Client::GodScope gs; - readlocktryassert rl(/*"admin.system.users", */10000); + readlocktry rl(/*"admin.system.users", */10000); + uassert( 16174 , "couldn't get read lock to check admin user" , rl.got() ); Client::Context cx( "admin.system.users" ); BSONObj user; if ( Helpers::findOne( "admin.system.users" , BSON( "user" << username ) , user ) ) |