Skip to content

Commit

Permalink
Allow constructing a plain StopToken from a shared StopSource
Browse files Browse the repository at this point in the history
  • Loading branch information
skoppe committed Jul 20, 2021
1 parent 1d339d8 commit b655021
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions source/concurrency/stoptoken.d
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ struct StopToken {
this.source = source;
}

this(shared StopSource source) nothrow @trusted @nogc {
this.source = cast()source;
}

bool isStopRequested() nothrow @safe @nogc {
return source.isStopRequested();
}
Expand Down

0 comments on commit b655021

Please sign in to comment.