Skip to content

Commit

Permalink
Fix non-blocking react { await blah() }
Browse files Browse the repository at this point in the history
The `react` (and also `await $some-supply`) constructs will tap the
`Supply` upon the call to `subscribe-awaiter`. This causes some
amount of synchronous execution to take place, and that code may then
itself `await`. This broke because the continuation tag was removed
by the react/await prior to this. Protect the continuation tag, so it
survives.
  • Loading branch information
jnthn committed Sep 19, 2017
1 parent f53d396 commit 29863a0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/ThreadPoolScheduler.pm
Expand Up @@ -48,7 +48,7 @@ my class ThreadPoolScheduler does Scheduler {
else {
my $success;
my $result;
nqp::continuationcontrol(0, THREAD_POOL_PROMPT, -> Mu \c {
nqp::continuationcontrol(1, THREAD_POOL_PROMPT, -> Mu \c {
$handle.subscribe-awaiter(-> \success, \result {
$success := success;
$result := result;
Expand Down Expand Up @@ -150,7 +150,7 @@ my class ThreadPoolScheduler does Scheduler {
$l.unlock();
}
}
nqp::continuationcontrol(0, THREAD_POOL_PROMPT, -> Mu \c {
nqp::continuationcontrol(1, THREAD_POOL_PROMPT, -> Mu \c {
$continuation := c;
$l.unlock;
});
Expand Down

0 comments on commit 29863a0

Please sign in to comment.