Skip to content

Commit

Permalink
SelectState: Instantiate the FiberBlocker in the caller
Browse files Browse the repository at this point in the history
Remove dependency on the global state.
  • Loading branch information
Geod24 committed Mar 4, 2021
1 parent ab5c6fb commit e0b3c02
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions source/geod24/concurrency.d
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ public SelectReturn select (ref SelectEntry[] read_list, ref SelectEntry[] write
{
import std.random : randomShuffle;

auto ss = new SelectState();
auto ss = new SelectState(thisScheduler().new FiberBlocker());
int sel_id = 0;
thisScheduler().addResource(ss);
scope (exit) thisScheduler().removeResource(ss);
Expand Down Expand Up @@ -775,9 +775,9 @@ final private class SelectState : FiberScheduler.Resource
***********************************************************************/

this () nothrow
this (FiberScheduler.FiberBlocker blocker) @safe pure nothrow @nogc
{
this.blocker = thisScheduler().new FiberBlocker();
this.blocker = blocker;
}

/***********************************************************************
Expand Down

0 comments on commit e0b3c02

Please sign in to comment.