| 1 | |
|---|---|
| 2 | // Copyright Oliver Kowalke 2013. |
| 3 | // Distributed under the Boost Software License, Version 1.0. |
| 4 | // (See accompanying file LICENSE_1_0.txt or copy at |
| 5 | // http://www.boost.org/LICENSE_1_0.txt) |
| 6 | |
| 7 | #ifndef BOOST_FIBERS_DETAIL_CONVERT_H |
| 8 | #define BOOST_FIBERS_DETAIL_CONVERT_H |
| 9 | |
| 10 | #include <chrono> |
| 11 | #include <memory> |
| 12 | |
| 13 | #include <boost/config.hpp> |
| 14 | |
| 15 | #include <boost/fiber/detail/config.hpp> |
| 16 | |
| 17 | #ifdef BOOST_HAS_ABI_HEADERS |
| 18 | # include BOOST_ABI_PREFIX |
| 19 | #endif |
| 20 | |
| 21 | namespace boost { |
| 22 | namespace fibers { |
| 23 | namespace detail { |
| 24 | |
| 25 | inline |
| 26 | std::chrono::steady_clock::time_point convert( |
| 27 | std::chrono::steady_clock::time_point const& timeout_time) noexcept { |
| 28 | return timeout_time; |
| 29 | } |
| 30 | |
| 31 | template< typename Clock, typename Duration > |
| 32 | std::chrono::steady_clock::time_point convert( |
| 33 | std::chrono::time_point< Clock, Duration > const& timeout_time) { |
| 34 | return std::chrono::steady_clock::now() + ( timeout_time - Clock::now() ); |
| 35 | } |
| 36 | |
| 37 | }}} |
| 38 | |
| 39 | #ifdef BOOST_HAS_ABI_HEADERS |
| 40 | # include BOOST_ABI_SUFFIX |
| 41 | #endif |
| 42 | |
| 43 | #endif // BOOST_FIBERS_DETAIL_CONVERT_H |
| 44 |
