summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2010-06-08 13:03:10 -0400
committerEliot Horowitz <eliot@10gen.com>2010-06-08 13:03:10 -0400
commitecae23c29f4bebd030bbf1e65ecbf2b5c57be108 (patch)
tree6d36804c94b571aa6a3f72833b4366230bd2980d
parent5ac1a08dbb9532ad0e52af6ce6fe508d122f329f (diff)
downloadmongo-ecae23c29f4bebd030bbf1e65ecbf2b5c57be108.tar.gz
fix old boost version
-rw-r--r--db/concurrency.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/db/concurrency.h b/db/concurrency.h
index 40c96904cba..c6444bc6c95 100644
--- a/db/concurrency.h
+++ b/db/concurrency.h
@@ -262,9 +262,13 @@ namespace mongo {
}
bool lock_try(){
- // old boost doesn't have try_lock :(
- lock();
- return true;
+ boost::system_time until = get_system_time();
+ until += boost::posix_time::milliseconds(0);
+ if( m.timed_lock( until ) ) {
+ _minfo.entered();
+ return true;
+ }
+ return false;
}
void releaseEarly() {