/usr/include/boost/fiber
NameSizeModeActions
algo/-0755rm
cuda/-0755rm
detail/-0755rm
future/-0755rm
hip/-0755rm
numa/-0755rm
all.hpp13810644editdlrm
barrier.hpp10220644editdlrm
buffered_channel.hpp255790644editdlrm
channel_op_status.hpp6780644editdlrm
condition_variable.hpp87120644editdlrm
context.hpp159270644editdlrm
exceptions.hpp33520644editdlrm
fiber.hpp45490644editdlrm
fixedsize_stack.hpp7820644editdlrm
fss.hpp25930644editdlrm
future.hpp3840644editdlrm
mutex.hpp13730644editdlrm
operations.hpp30340644editdlrm
policy.hpp8120644editdlrm
pooled_fixedsize_stack.hpp7210644editdlrm
properties.hpp20770644editdlrm
protected_fixedsize_stack.hpp7390644editdlrm
recursive_mutex.hpp16480644editdlrm
recursive_timed_mutex.hpp23800644editdlrm
scheduler.hpp55250644editdlrm
segmented_stack.hpp8170644editdlrm
timed_mutex.hpp21050644editdlrm
type.hpp23320644editdlrm
unbuffered_channel.hpp267860644editdlrm
Edit: /usr/include/boost/fiber/operations.hpp (3034B)
// 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_THIS_FIBER_OPERATIONS_H #define BOOST_THIS_FIBER_OPERATIONS_H #include #include #include #include #include #include #include #include #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif namespace boost { namespace this_fiber { inline fibers::fiber::id get_id() noexcept { return fibers::context::active()->get_id(); } inline void yield() noexcept { fibers::context::active()->yield(); } template< typename Clock, typename Duration > void sleep_until( std::chrono::time_point< Clock, Duration > const& sleep_time_) { std::chrono::steady_clock::time_point sleep_time = boost::fibers::detail::convert( sleep_time_); fibers::context * active_ctx = fibers::context::active(); active_ctx->twstatus.store( static_cast< std::intptr_t >( 0), std::memory_order_release); active_ctx->wait_until( sleep_time); } template< typename Rep, typename Period > void sleep_for( std::chrono::duration< Rep, Period > const& timeout_duration) { fibers::context * active_ctx = fibers::context::active(); active_ctx->twstatus.store( static_cast< std::intptr_t >( 0), std::memory_order_release); active_ctx->wait_until( std::chrono::steady_clock::now() + timeout_duration); } template< typename PROPS > PROPS & properties() { fibers::fiber_properties * props = fibers::context::active()->get_properties(); if ( BOOST_LIKELY( nullptr == props) ) { // props could be nullptr if the thread's main fiber has not yet // yielded (not yet passed through algorithm_with_properties:: // awakened()). Address that by yielding right now. yield(); // Try again to obtain the fiber_properties subclass instance ptr. // Walk through the whole chain again because who knows WHAT might // have happened while we were yielding! props = fibers::context::active()->get_properties(); // Could still be hosed if the running manager isn't a subclass of // algorithm_with_properties. BOOST_ASSERT_MSG( props, "this_fiber::properties not set"); } return dynamic_cast< PROPS & >( * props ); } } namespace fibers { inline bool has_ready_fibers() noexcept { return boost::fibers::context::active()->get_scheduler()->has_ready_fibers(); } template< typename SchedAlgo, typename ... Args > void use_scheduling_algorithm( Args && ... args) noexcept { boost::fibers::context::active()->get_scheduler() ->set_algo( new SchedAlgo( std::forward< Args >( args) ... ) ); } }} #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif #endif // BOOST_THIS_FIBER_OPERATIONS_H