Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

more fixes for ThreadSpanningOp

  • Loading branch information...
commit c949cad1fa6e4cb26693748b1751f4fd2e6113b8 1 parent 5c822e5
@erh erh authored
View
5 src/mongo/db/d_concurrency.cpp
@@ -236,11 +236,14 @@ namespace mongo {
threadState() = 0;
}
void Lock::ThreadSpanningOp::unsetR() {
- assert( threadState() == 'R' );
@dwight Owner
dwight added a note

not sure exactly how this has evolved but originally the idea was that with ThreadSpanningOp when you use it, you use it only and it wasn't designed to interoperate with the other Lock:: classes and stuff. thus it didn't set threadstate for example. it is fine if it is different but does this now imply i can use ThreadSpanningOp interoperably with all the other Lock:: classes? i imagine it won't play nicely with them. will read more later.

@erh Owner
erh added a note
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ assert( threadState() == 'R' || threadState() == 0 );
q.unlock_R();
q.start_greed();
threadState() = 0;
}
+ void Lock::ThreadSpanningOp::handoffR() {
+ threadState() = 0;
+ }
int Lock::isLocked() {
return threadState();
View
1  src/mongo/db/d_concurrency.h
@@ -77,6 +77,7 @@ namespace mongo {
static void W_to_R();
static void unsetW(); // reverts to greedy
static void unsetR(); // reverts to greedy
+ static void handoffR(); // doesn't unlock, but changes my thread state back to ''
};
};
View
1  src/mongo/db/dbcommands_admin.cpp
@@ -464,6 +464,7 @@ namespace mongo {
log() << " For more info see " << FSyncCommand::url() << endl;
result.append("info", "now locked against writes, use db.fsyncUnlock() to unlock");
result.append("seeAlso", url());
+ Lock::ThreadSpanningOp::handoffR();
}
else {
// the simple fsync command case
Please sign in to comment.
Something went wrong with that request. Please try again.