summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authordwight <dwight@10gen.com>2011-11-23 11:03:11 -0500
committerdwight <dwight@10gen.com>2011-11-23 11:03:50 -0500
commit9ee0c52df8fd0d17477927eebe990ac27e5a691a (patch)
treee8fd8a98e10326673a4d919d10a882e3563ec73b /db
parentbcf554fbeba4739c1f86ced4114ce3b953084faa (diff)
downloadmongo-9ee0c52df8fd0d17477927eebe990ac27e5a691a.tar.gz
tweak mongomutex and ocmments
Diffstat (limited to 'db')
-rw-r--r--db/mongomutex.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/db/mongomutex.h b/db/mongomutex.h
index 9eb8964ec86..25612f7596b 100644
--- a/db/mongomutex.h
+++ b/db/mongomutex.h
@@ -87,7 +87,7 @@ namespace mongo {
bool atLeastReadLocked() const { return _state.get() != 0; }
void assertAtLeastReadLocked() const { assert(atLeastReadLocked()); }
- bool isWriteLocked() const { return getState() > 0; }
+ bool isWriteLocked/*by our thread*/() const { return getState() > 0; }
void assertWriteLocked() const {
assert( getState() > 0 );
DEV assert( !_releasedEarly.get() );
@@ -113,7 +113,7 @@ namespace mongo {
// try write lock
bool lock_try( int millis ) {
- if ( _writeLockedAlready() )
+ if ( _writeLockedAlready() ) // adjusts _state
return true;
Client *c = curopWaitingForLock( 1 );
@@ -343,7 +343,7 @@ namespace mongo {
if you have a write lock, that's ok too.
*/
struct atleastreadlock {
- atleastreadlock( const string& ns ) {
+ atleastreadlock( const string& ns = "" ) {
_prev = dbMutex.getState();
if ( _prev == 0 )
dbMutex.lock_shared();