-
Notifications
You must be signed in to change notification settings - Fork 67
Temporal kills #169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Temporal kills #169
Changes from 6 commits
aa162d2
37a9af9
1c41cee
f2d414b
24d2568
206f3b9
bccb409
127fd21
e03b941
38fa57a
3601775
a99e896
0d7c02c
0dcd3cf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -320,24 +320,32 @@ var Aff = function () { | |
|
|
||
| case ASYNC: | ||
| status = PENDING; | ||
| step = runAsync(util.left, step._1, function (result) { | ||
| return function () { | ||
| if (runTick !== localRunTick) { | ||
| return; | ||
| } | ||
| runTick++; | ||
| Scheduler.enqueue(function () { | ||
| // It's possible to interrupt the fiber between enqueuing and | ||
| // resuming, so we need to check that the runTick is still | ||
| // valid. | ||
| var asyncAction = step._1; | ||
| step = nonCanceler; | ||
| Scheduler.enqueue(function () { | ||
| if (runTick !== localRunTick) { | ||
| return; | ||
| } | ||
| ++runTick; | ||
|
||
| var resolved = false; | ||
|
||
| var canceler = runAsync(util.left, asyncAction, function (result) { | ||
| return function () { | ||
| if (runTick !== localRunTick + 1) { | ||
| return; | ||
| } | ||
| ++runTick; | ||
| resolved = true; | ||
| status = STEP_RESULT; | ||
| step = result; | ||
| step = result; | ||
| run(runTick); | ||
| }); | ||
| }; | ||
| }; | ||
| }); | ||
| // Only update the canceler if the asynchronous action has not | ||
| // resolved synchronously. If it has, then the next status and | ||
| // step have already been set. | ||
| if (!resolved) { | ||
| step = canceler; | ||
| } | ||
| }); | ||
| return; | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
tmpregister is for stuff like this. I'd prefer to not introduce avarin the middle of a switch.