diff -up ./boost/thread/pthread/condition_variable.hpp~ ./boost/thread/pthread/condition_variable.hpp
old
|
new
|
namespace boost
|
200 | 200 | |
201 | 201 | #if defined BOOST_THREAD_USES_DATETIME |
202 | 202 | template<typename lock_type> |
203 | | bool timed_wait(lock_type& m,boost::system_time const& wait_until) |
| 203 | bool timed_wait(lock_type& m,boost::system_time const& a_wait_until) |
204 | 204 | { |
205 | | struct timespec const timeout=detail::to_timespec(wait_until); |
| 205 | struct timespec const timeout=detail::to_timespec(a_wait_until); |
206 | 206 | return do_wait_until(m, timeout); |
207 | 207 | } |
208 | 208 | template<typename lock_type> |
209 | | bool timed_wait(lock_type& m,xtime const& wait_until) |
| 209 | bool timed_wait(lock_type& m,xtime const& a_wait_until) |
210 | 210 | { |
211 | | return timed_wait(m,system_time(wait_until)); |
| 211 | return timed_wait(m,system_time(a_wait_until)); |
212 | 212 | } |
213 | 213 | |
214 | 214 | template<typename lock_type,typename duration_type> |
… |
… |
namespace boost
|
218 | 218 | } |
219 | 219 | |
220 | 220 | template<typename lock_type,typename predicate_type> |
221 | | bool timed_wait(lock_type& m,boost::system_time const& wait_until,predicate_type pred) |
| 221 | bool timed_wait(lock_type& m,boost::system_time const& a_wait_until,predicate_type pred) |
222 | 222 | { |
223 | 223 | while (!pred()) |
224 | 224 | { |
225 | | if(!timed_wait(m, wait_until)) |
| 225 | if(!timed_wait(m, a_wait_until)) |
226 | 226 | return pred(); |
227 | 227 | } |
228 | 228 | return true; |
229 | 229 | } |
230 | 230 | |
231 | 231 | template<typename lock_type,typename predicate_type> |
232 | | bool timed_wait(lock_type& m,xtime const& wait_until,predicate_type pred) |
| 232 | bool timed_wait(lock_type& m,xtime const& a_wait_until,predicate_type pred) |
233 | 233 | { |
234 | | return timed_wait(m,system_time(wait_until),pred); |
| 234 | return timed_wait(m,system_time(a_wait_until),pred); |
235 | 235 | } |
236 | 236 | |
237 | 237 | template<typename lock_type,typename duration_type,typename predicate_type> |
diff -up ./boost/thread/pthread/condition_variable_fwd.hpp~ ./boost/thread/pthread/condition_variable_fwd.hpp
old
|
new
|
namespace boost
|
98 | 98 | #if defined BOOST_THREAD_USES_DATETIME |
99 | 99 | inline bool timed_wait( |
100 | 100 | unique_lock<mutex>& m, |
101 | | boost::system_time const& wait_until) |
| 101 | boost::system_time const& a_wait_until) |
102 | 102 | { |
103 | 103 | #if defined BOOST_THREAD_WAIT_BUG |
104 | | struct timespec const timeout=detail::to_timespec(wait_until + BOOST_THREAD_WAIT_BUG); |
| 104 | struct timespec const timeout=detail::to_timespec(a_wait_until + BOOST_THREAD_WAIT_BUG); |
105 | 105 | return do_wait_until(m, timeout); |
106 | 106 | #else |
107 | | struct timespec const timeout=detail::to_timespec(wait_until); |
| 107 | struct timespec const timeout=detail::to_timespec(a_wait_until); |
108 | 108 | return do_wait_until(m, timeout); |
109 | 109 | #endif |
110 | 110 | } |
111 | 111 | bool timed_wait( |
112 | 112 | unique_lock<mutex>& m, |
113 | | xtime const& wait_until) |
| 113 | xtime const& a_wait_until) |
114 | 114 | { |
115 | | return timed_wait(m,system_time(wait_until)); |
| 115 | return timed_wait(m,system_time(a_wait_until)); |
116 | 116 | } |
117 | 117 | |
118 | 118 | template<typename duration_type> |
… |
… |
namespace boost
|
126 | 126 | template<typename predicate_type> |
127 | 127 | bool timed_wait( |
128 | 128 | unique_lock<mutex>& m, |
129 | | boost::system_time const& wait_until,predicate_type pred) |
| 129 | boost::system_time const& a_wait_until,predicate_type pred) |
130 | 130 | { |
131 | 131 | while (!pred()) |
132 | 132 | { |
133 | | if(!timed_wait(m, wait_until)) |
| 133 | if(!timed_wait(m, a_wait_until)) |
134 | 134 | return pred(); |
135 | 135 | } |
136 | 136 | return true; |
… |
… |
namespace boost
|
139 | 139 | template<typename predicate_type> |
140 | 140 | bool timed_wait( |
141 | 141 | unique_lock<mutex>& m, |
142 | | xtime const& wait_until,predicate_type pred) |
| 142 | xtime const& a_wait_until,predicate_type pred) |
143 | 143 | { |
144 | | return timed_wait(m,system_time(wait_until),pred); |
| 144 | return timed_wait(m,system_time(a_wait_until),pred); |
145 | 145 | } |
146 | 146 | |
147 | 147 | template<typename duration_type,typename predicate_type> |