Skip to content

Commit

Permalink
the journaling thread upgrades its qlock from R to W when it needs to…
Browse files Browse the repository at this point in the history
… REMAPPRIVATEVIEW. this upgrade

was not greedy and that was probably a bug. fixed.
  • Loading branch information
dwight committed Apr 25, 2012
1 parent 007d202 commit 50a2d2c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/mongo/db/d_concurrency.cpp
Expand Up @@ -666,6 +666,11 @@ namespace mongo {
bool Lock::GlobalWrite::upgrade() {
verify( !noop );
verify( threadState() == 'R' );
if( stoppedGreed ) {
// we undo stopgreed here if it were set earlier, as we now want a W lock
stoppedGreed = false;
q.start_greed();
}
if( q.R_to_W() ) {
lockState().changeLockState( 'W' );
return true;
Expand Down
2 changes: 1 addition & 1 deletion src/mongo/db/d_concurrency.h
Expand Up @@ -56,7 +56,7 @@ namespace mongo {
// i.e. you could grab globalread after globalwrite.

class GlobalWrite : public ScopedLock {
const bool stoppedGreed;
bool stoppedGreed;
bool noop;
protected:
void tempRelease();
Expand Down

0 comments on commit 50a2d2c

Please sign in to comment.