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:
@@ -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>
|
||||
|
||||
@@ -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
|
||||
|
||||
40
include/boost/fiber/detail/convert.hpp
Normal file
40
include/boost/fiber/detail/convert.hpp
Normal 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
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user