2
0
mirror of https://github.com/boostorg/fiber.git synced 2026-02-02 08:52:07 +00:00

move conver_tp() to separate file

This commit is contained in:
Oliver Kowalke
2014-07-10 19:45:54 +02:00
parent 7ef6302f86
commit cff7bc7ea5
6 changed files with 44 additions and 17 deletions

View File

@@ -19,6 +19,7 @@
#include <boost/utility.hpp>
#include <boost/fiber/detail/config.hpp>
#include <boost/fiber/detail/convert.hpp>
#include <boost/fiber/detail/main_fiber.hpp>
#include <boost/fiber/detail/fiber_base.hpp>
#include <boost/fiber/detail/spinlock.hpp>

View File

@@ -7,7 +7,6 @@
#ifndef BOOST_FIBERS_DETAIL_CONFIG_H
#define BOOST_FIBERS_DETAIL_CONFIG_H
#include <boost/chrono/system_clocks.hpp>
#include <boost/config.hpp>
#include <boost/detail/workaround.hpp>
@@ -43,21 +42,5 @@
# define BOOST_FIBERS_SEGMENTS 10
#endif
namespace boost {
namespace fibers {
namespace detail {
inline
chrono::high_resolution_clock::time_point convert_tp( chrono::high_resolution_clock::time_point const& timeout_time)
{ return timeout_time; }
template< typename TimePointType >
chrono::high_resolution_clock::time_point convert_tp( TimePointType const& timeout_time)
{
typedef typename TimePointType::clock ClockType;
return chrono::high_resolution_clock::now() + ( timeout_time - ClockType::now() );
}
}}}
#endif // BOOST_FIBERS_DETAIL_CONFIG_H

View File

@@ -0,0 +1,40 @@
// Copyright Oliver Kowalke 2013.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_FIBERS_DETAIL_CONVERT_H
#define BOOST_FIBERS_DETAIL_CONVERT_H
#include <boost/chrono/system_clocks.hpp>
#include <boost/config.hpp>
#include <boost/fiber/detail/config.hpp>
#ifdef BOOST_HAS_ABI_HEADERS
# include BOOST_ABI_PREFIX
#endif
namespace boost {
namespace fibers {
namespace detail {
inline
chrono::high_resolution_clock::time_point convert_tp( chrono::high_resolution_clock::time_point const& timeout_time)
{ return timeout_time; }
template< typename TimePointType >
chrono::high_resolution_clock::time_point convert_tp( TimePointType const& timeout_time)
{
typedef typename TimePointType::clock ClockType;
return chrono::high_resolution_clock::now() + ( timeout_time - ClockType::now() );
}
}}}
#ifdef BOOST_HAS_ABI_HEADERS
# include BOOST_ABI_SUFFIX
#endif
#endif // BOOST_FIBERS_DETAIL_CONVERT_H

View File

@@ -14,6 +14,7 @@
#include <boost/utility.hpp>
#include <boost/fiber/detail/config.hpp>
#include <boost/fiber/detail/convert.hpp>
#include <boost/fiber/detail/main_fiber.hpp>
#include <boost/fiber/detail/spinlock.hpp>
#include <boost/fiber/detail/waiting_queue.hpp>

View File

@@ -17,6 +17,7 @@
#include <boost/utility.hpp>
#include <boost/fiber/detail/config.hpp>
#include <boost/fiber/detail/convert.hpp>
#include <boost/fiber/detail/worker_fiber.hpp>
#include <boost/fiber/detail/spinlock.hpp>
#include <boost/fiber/detail/fiber_base.hpp>

View File

@@ -14,6 +14,7 @@
#include <boost/utility.hpp>
#include <boost/fiber/detail/config.hpp>
#include <boost/fiber/detail/convert.hpp>
#include <boost/fiber/detail/worker_fiber.hpp>
#include <boost/fiber/detail/fiber_base.hpp>
#include <boost/fiber/detail/spinlock.hpp>