| 134 | #if defined BOOST_THREAD_USES_DATETIME |
| 135 | template<typename TimeDuration> |
| 136 | bool timed_lock(TimeDuration const & relative_time) |
| 137 | { |
| 138 | if (relative_time.is_pos_infinity()) |
| 139 | { |
| 140 | lock(); |
| 141 | return true; |
| 142 | } |
| 143 | if (relative_time.is_special()) |
| 144 | { |
| 145 | return true; |
| 146 | } |
| 147 | detail::platform_duration d(relative_time); |
| 148 | #if defined(BOOST_THREAD_HAS_MONO_CLOCK) && !defined(BOOST_THREAD_INTERNAL_CLOCK_IS_MONO) |
| 149 | const detail::mono_platform_timepoint ts(detail::mono_platform_clock::now() + d); |
| 150 | d = (std::min)(d, detail::platform_milliseconds(BOOST_THREAD_POLL_INTERVAL_MILLISECONDS)); |
| 151 | while ( ! do_try_lock_until(detail::internal_platform_clock::now() + d) ) |
| 152 | { |
| 153 | d = ts - detail::mono_platform_clock::now(); |
| 154 | if ( d <= detail::platform_duration::zero() ) return false; // timeout occurred |
| 155 | d = (std::min)(d, detail::platform_milliseconds(BOOST_THREAD_POLL_INTERVAL_MILLISECONDS)); |
| 156 | } |
| 157 | return true; |
| 158 | #else |
| 159 | return do_try_lock_until(detail::internal_platform_clock::now() + d); |
| 160 | #endif |
| 161 | } |
| 162 | bool timed_lock(boost::xtime const & absolute_time) |
| 163 | { |
| 164 | return timed_lock(system_time(absolute_time)); |
nothing calls this directly
no test coverage detected