From 548cb08672b5a0ed0fba39f623efb8798aa783fd Mon Sep 17 00:00:00 2001 From: Oliver Kowalke Date: Thu, 31 Jan 2013 17:47:44 +0100 Subject: [PATCH] remove timed_wait() operations - condition and future<> do not support timed wait --- include/boost/fiber/bounded_channel.hpp | 8 ++++---- include/boost/fiber/condition.hpp | 5 +++-- include/boost/fiber/future.hpp | 11 ++++++----- include/boost/fiber/unbounded_channel.hpp | 4 ++-- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/include/boost/fiber/bounded_channel.hpp b/include/boost/fiber/bounded_channel.hpp index 6e70f68d..584b71cd 100644 --- a/include/boost/fiber/bounded_channel.hpp +++ b/include/boost/fiber/bounded_channel.hpp @@ -198,7 +198,7 @@ public: } not_empty_cond_.notify_one(); } - +#if 0 template< typename TimeDuration > bool put( T const& t, TimeDuration const& dt) { return put( t, chrono::system_clock::now() + dt); } @@ -229,7 +229,7 @@ public: not_empty_cond_.notify_one(); return true; } - +#endif bool take( value_type & va) { mutex::scoped_lock lk( head_mtx_); @@ -261,7 +261,7 @@ public: } return va; } - +#if 0 template< typename TimeDuration > bool take( value_type & va, TimeDuration const& dt) { return take( va, chrono::system_clock::now() + dt); } @@ -300,7 +300,7 @@ public: } return va; } - +#endif bool try_take( value_type & va) { mutex::scoped_lock lk( head_mtx_); diff --git a/include/boost/fiber/condition.hpp b/include/boost/fiber/condition.hpp index 337f3479..f8ec42c7 100644 --- a/include/boost/fiber/condition.hpp +++ b/include/boost/fiber/condition.hpp @@ -147,14 +147,14 @@ public: } //Unlock the enter mutex if it is a single notification, if this is - //the last notified thread in a notify_all or a timeout has occurred + //the last notified fiber in a notify_all or a timeout has occurred if ( unlock_enter_mtx) enter_mtx_.unlock(); //Lock external again before returning from the method lt.lock(); } - +#if 0 template< typename LockType, typename TimeDuration > bool timed_wait( LockType & lt, TimeDuration const& dt) { return timed_wait( lt, chrono::system_clock::now() + dt); } @@ -286,6 +286,7 @@ public: lt.lock(); return ! timed_out; } +#endif }; typedef condition condition_variable; diff --git a/include/boost/fiber/future.hpp b/include/boost/fiber/future.hpp index c68a58e2..2dbcd8b2 100644 --- a/include/boost/fiber/future.hpp +++ b/include/boost/fiber/future.hpp @@ -218,7 +218,7 @@ namespace fibers { boost::rethrow_exception(exception); } } - +#if 0 bool timed_wait_until(chrono::system_clock::time_point const& target_time) { boost::unique_lock lock(mutex); @@ -233,7 +233,7 @@ namespace fibers { } return true; } - +#endif void mark_exceptional_finish_internal(boost::exception_ptr const& e, boost::unique_lock& lock) { @@ -693,7 +693,7 @@ namespace fibers { } future->wait(false); } - +#if 0 template bool timed_wait(Duration const& rel_time) const { @@ -708,7 +708,7 @@ namespace fibers { } return future->timed_wait_until(abs_time); } - +#endif template unique_future then(RF(*func)(unique_future< R >&)) @@ -891,7 +891,7 @@ namespace fibers { } future->wait(false); } - +#if 0 template bool timed_wait(Duration const& rel_time) const { @@ -906,6 +906,7 @@ namespace fibers { } return future->timed_wait_until(abs_time); } +#endif }; template diff --git a/include/boost/fiber/unbounded_channel.hpp b/include/boost/fiber/unbounded_channel.hpp index 8a2c47f4..8c73e228 100644 --- a/include/boost/fiber/unbounded_channel.hpp +++ b/include/boost/fiber/unbounded_channel.hpp @@ -165,7 +165,7 @@ public: pop_head_(); return va; } - +#if 0 template< typename TimeDuration > bool take( value_type & va, TimeDuration const& dt) { return take( va, chrono::system_clock::now() + dt); } @@ -195,7 +195,7 @@ public: pop_head_(); return va; } - +#endif bool try_take( value_type & va) { mutex::scoped_lock lk( head_mtx_);