mirror of
https://github.com/boostorg/fiber.git
synced 2026-02-10 23:32:28 +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:
@@ -53,7 +53,7 @@ recursive_mutex::~recursive_mutex() {
|
||||
|
||||
void
|
||||
recursive_mutex::lock() {
|
||||
fiber_context * f( detail::scheduler::instance()->active() );
|
||||
fiber_context * f( fiber_context::active() );
|
||||
BOOST_ASSERT( nullptr != f);
|
||||
for (;;) {
|
||||
detail::spinlock_lock lk( splk_);
|
||||
@@ -67,7 +67,7 @@ recursive_mutex::lock() {
|
||||
waiting_.push_back( f);
|
||||
|
||||
// suspend this fiber
|
||||
detail::scheduler::instance()->wait( lk);
|
||||
fiber_context::active()->do_wait( lk);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user