2
0
mirror of https://github.com/boostorg/fiber.git synced 2026-02-16 13:22:17 +00:00

remove class scheduler - fiber_context has static TLS

- detail:.scheduler was removed
- fiber_context has a static thread-local pointer to the active
  fiber_context
- fiber_context has member to pointer of fiber_manager
- functions of fiber_manager are accessed only via fiber_context
- if fiber f is resumed, the fiber_manager of the current active fiber
  f' is assigned to f
  -> that is necessary if f was stolen form another thread
This commit is contained in:
Oliver Kowalke
2015-09-07 11:50:01 +02:00
parent 26ea3aa41c
commit 7233f617d7
18 changed files with 250 additions and 185 deletions

View File

@@ -24,7 +24,7 @@ namespace fibers {
void
fiber::start_() {
impl_->set_ready();
detail::scheduler::instance()->spawn( impl_.get() );
fiber_context::active()->do_spawn( * this);
}
void
@@ -41,7 +41,7 @@ fiber::join() {
"boost fiber: fiber not joinable");
}
detail::scheduler::instance()->join( impl_.get() );
fiber_context::active()->do_join( impl_.get() );
// check if joined fiber was interrupted
std::exception_ptr except( impl_->get_exception() );