Don't crash if a process yields and gets killed before it is next scheduled

This commit is contained in:
Tony Garnock-Jones 2012-06-11 12:32:18 -04:00
parent 75d40c7abc
commit ee1ec3ceda
1 changed files with 5 additions and 1 deletions

View File

@ -287,7 +287,11 @@
(let-values (((transformed-preaction state) (transform-meta-action pid preaction state)))
(loop rest state (cons transformed-preaction outbound-actions)))]
[(yield k)
(loop rest (run-ready state pid k) outbound-actions)]
(loop rest
(if (hash-has-key? (vm-processes state) pid)
(run-ready state pid k)
state)
outbound-actions)]
[preaction
(let-values (((new-outbound-actions-rev state) (perform-action pid preaction state)))
(loop rest state (append new-outbound-actions-rev outbound-actions)))])])))