2
0
mirror of https://github.com/boostorg/fiber.git synced 2026-02-22 03:12:28 +00:00

add interruption point after fiber_manager::run()

- functions fiber_manager::join()/fiber_manager::yield()/fiber_manager:.wait()/fiber_manager_wait_until()
  check for interrption of the current fiber
This commit is contained in:
Oliver Kowalke
2015-06-21 10:53:37 +02:00
parent 6c35324727
commit 5d18cd5a4e
8 changed files with 660 additions and 621 deletions

View File

@@ -12,9 +12,10 @@
#include <boost/assert.hpp>
#include "boost/fiber/algorithm.hpp"
#include "boost/fiber/fiber_context.hpp"
#include "boost/fiber/detail/scheduler.hpp"
#include "boost/fiber/exceptions.hpp"
#include "boost/fiber/fiber_context.hpp"
#include "boost/fiber/interruption.hpp"
#include "boost/fiber/round_robin.hpp"
#ifdef BOOST_HAS_ABI_HEADERS
@@ -152,6 +153,10 @@ fiber_manager::wait_until( std::chrono::high_resolution_clock::time_point const&
run();
// fiber is resumed
// this fiber was notified and resumed
// check if fiber was interrupted
this_fiber::interruption_point();
return std::chrono::high_resolution_clock::now() < timeout_time;
}
@@ -166,6 +171,10 @@ fiber_manager::yield() {
// switch to another fiber
run();
// fiber is resumed
// this fiber was notified and resumed
// check if fiber was interrupted
this_fiber::interruption_point();
}
void
@@ -188,6 +197,10 @@ fiber_manager::join( fiber_context * f) {
run();
// fiber is resumed
// this fiber was notified and resumed
// check if fiber was interrupted
this_fiber::interruption_point();
BOOST_ASSERT( f->is_terminated() );
}