mirror of
https://github.com/boostorg/fiber.git
synced 2026-02-20 02:32:19 +00:00
use yield-queue because work-sharing
- yield-queue prevents resumtion of a fiber which is passed to awakened() but has not yet suspended
This commit is contained in:
@@ -170,6 +170,7 @@ context::context( main_context_t) :
|
||||
terminated_hook_(),
|
||||
ready_hook_(),
|
||||
remote_ready_hook_(),
|
||||
yield_hook_(),
|
||||
sleep_hook_(),
|
||||
wait_hook_(),
|
||||
tp_( (std::chrono::steady_clock::time_point::max)() ),
|
||||
@@ -197,6 +198,7 @@ context::context( dispatcher_context_t, boost::context::preallocated const& pall
|
||||
terminated_hook_(),
|
||||
ready_hook_(),
|
||||
remote_ready_hook_(),
|
||||
yield_hook_(),
|
||||
sleep_hook_(),
|
||||
wait_hook_(),
|
||||
tp_( (std::chrono::steady_clock::time_point::max)() ),
|
||||
@@ -418,6 +420,12 @@ context::remote_ready_is_linked() {
|
||||
return remote_ready_hook_.is_linked();
|
||||
}
|
||||
|
||||
bool
|
||||
context::yield_is_linked() {
|
||||
std::unique_lock< detail::spinlock > lk( hook_splk_);
|
||||
return yield_hook_.is_linked();
|
||||
}
|
||||
|
||||
bool
|
||||
context::sleep_is_linked() {
|
||||
std::unique_lock< detail::spinlock > lk( hook_splk_);
|
||||
@@ -448,6 +456,12 @@ context::remote_ready_unlink() {
|
||||
remote_ready_hook_.unlink();
|
||||
}
|
||||
|
||||
void
|
||||
context::yield_unlink() {
|
||||
std::unique_lock< detail::spinlock > lk( hook_splk_);
|
||||
yield_hook_.unlink();
|
||||
}
|
||||
|
||||
void
|
||||
context::sleep_unlink() {
|
||||
std::unique_lock< detail::spinlock > lk( hook_splk_);
|
||||
|
||||
Reference in New Issue
Block a user