diff options
author | Eliot Horowitz <eliot@10gen.com> | 2010-06-08 13:03:10 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2010-06-08 13:03:10 -0400 |
commit | ecae23c29f4bebd030bbf1e65ecbf2b5c57be108 (patch) | |
tree | 6d36804c94b571aa6a3f72833b4366230bd2980d | |
parent | 5ac1a08dbb9532ad0e52af6ce6fe508d122f329f (diff) | |
download | mongo-ecae23c29f4bebd030bbf1e65ecbf2b5c57be108.tar.gz |
fix old boost version
-rw-r--r-- | db/concurrency.h | 10 |
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() { |