Boost logo

Boost-Commit :

From: anthony_at_[hidden]
Date: 2007-12-15 17:34:30


Author: anthonyw
Date: 2007-12-15 17:34:30 EST (Sat, 15 Dec 2007)
New Revision: 42086
URL: http://svn.boost.org/trac/boost/changeset/42086

Log:
added timed_wait overloads that take a duration
Text files modified:
   trunk/boost/thread/win32/condition_variable.hpp | 22 ++++++++++++++++++++++
   1 files changed, 22 insertions(+), 0 deletions(-)

Modified: trunk/boost/thread/win32/condition_variable.hpp
==============================================================================
--- trunk/boost/thread/win32/condition_variable.hpp (original)
+++ trunk/boost/thread/win32/condition_variable.hpp 2007-12-15 17:34:30 EST (Sat, 15 Dec 2007)
@@ -276,6 +276,16 @@
             return do_wait(m,wait_until);
         }
 
+ bool timed_wait(unique_lock<mutex>& m,boost::xtime const& wait_until)
+ {
+ return do_wait(m,system_time(wait_until));
+ }
+ template<typename duration_type>
+ bool timed_wait(unique_lock<mutex>& m,duration_type const& wait_duration)
+ {
+ return do_wait(m,wait_duration.total_milliseconds());
+ }
+
         template<typename predicate_type>
         bool timed_wait(unique_lock<mutex>& m,boost::system_time const& wait_until,predicate_type pred)
         {
@@ -315,6 +325,18 @@
             return do_wait(m,wait_until);
         }
 
+ template<typename lock_type>
+ bool timed_wait(lock_type& m,boost::xtime const& wait_until)
+ {
+ return do_wait(m,system_time(wait_until));
+ }
+
+ template<typename lock_type,typename duration_type>
+ bool timed_wait(lock_type& m,duration_type const& wait_duration)
+ {
+ return do_wait(m,wait_duration.total_milliseconds());
+ }
+
         template<typename lock_type,typename predicate_type>
         bool timed_wait(lock_type& m,boost::system_time const& wait_until,predicate_type pred)
         {


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk