Allow switchToTask to be called within a yield lock.
Enables waking up other tasks from within a yield lock (executed after the yield lock is lifted).
This commit is contained in:
parent
b5177894d2
commit
2480f6bb67
|
@ -689,7 +689,8 @@ void hibernate(scope void delegate() @safe nothrow on_interrupt = null)
|
||||||
*/
|
*/
|
||||||
void switchToTask(Task t)
|
void switchToTask(Task t)
|
||||||
@safe nothrow {
|
@safe nothrow {
|
||||||
s_scheduler.switchTo(t);
|
auto defer = TaskFiber.getThis().m_yieldLockCount > 0 ? Yes.defer : No.defer;
|
||||||
|
s_scheduler.switchTo(t, defer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue