Skip to content

Commit

Permalink
qlock can ask if in greedy mode or not
Browse files Browse the repository at this point in the history
  • Loading branch information
erh committed Mar 16, 2012
1 parent b45d00d commit c485104
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/mongo/util/concurrency/qlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ namespace mongo {
void W_to_R();
bool R_to_W(); // caution see notes below
void runExclusively(void (*f)(void));
bool isGreeedSuspended();
};

inline bool QLock::i_block(char me, char them) {
Expand Down Expand Up @@ -278,5 +279,8 @@ namespace mongo {
W.n--;
notifyWeUnlocked('W');
}

inline bool QLock::isGreeedSuspended() {
boost::mutex::scoped_lock lk(m);
return greedSuspended != 0;
}
}

0 comments on commit c485104

Please sign in to comment.