summaryrefslogtreecommitdiff
path: root/util/background.cpp
diff options
context:
space:
mode:
authorDwight <dmerriman@gmail.com>2008-11-03 20:42:59 -0500
committerDwight <dmerriman@gmail.com>2008-11-03 20:42:59 -0500
commita4968427e2eeec59f60c6f72a82d15ddd521347c (patch)
treebde1fcec8f960bf7cb2121c43ae75bb9319fee40 /util/background.cpp
parentac9bd9ce6020142548432b006d500dc70f8cfee2 (diff)
downloadmongo-a4968427e2eeec59f60c6f72a82d15ddd521347c.tar.gz
bug fix with $natural
timeout on connects w/dbgrid faster
Diffstat (limited to 'util/background.cpp')
-rw-r--r--util/background.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/util/background.cpp b/util/background.cpp
index 02f623b894e..e1dcb163754 100644
--- a/util/background.cpp
+++ b/util/background.cpp
@@ -24,12 +24,14 @@ boost::mutex BackgroundJob::mutex;
/* static */
void BackgroundJob::thr() {
assert( grab );
- assert( grab->state == NotStarted );
- grab->state = Running;
- grab->run();
- grab->state = Done;
- if( grab->deleteSelf )
- delete grab;
+ BackgroundJob *us = grab;
+ assert( us->state == NotStarted );
+ us->state = Running;
+ grab = 0;
+ us->run();
+ us->state = Done;
+ if( us->deleteSelf )
+ delete us;
}
BackgroundJob& BackgroundJob::go() {