From ecae23c29f4bebd030bbf1e65ecbf2b5c57be108 Mon Sep 17 00:00:00 2001 From: Eliot Horowitz Date: Tue, 8 Jun 2010 13:03:10 -0400 Subject: fix old boost version --- db/concurrency.h | 10 +++++++--- 1 file 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() { -- cgit v1.2.1