Skip to content

Commit 444e239

Browse files
committed
done can no longer be used to test whether a fsm is finished
1 parent 9d310d8 commit 444e239

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/processes.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function execute(ev::AbstractEvent, proc::Process)
3131
set_active_process(env, proc)
3232
target = proc.fsmi(value(ev))
3333
reset_active_process(env)
34-
if done(proc.fsmi)
34+
if proc.fsmi._state == 0xff
3535
schedule(proc; value=target)
3636
else
3737
proc.target = state(target) == processed ? timeout(env; value=value(target)) : target
@@ -56,7 +56,7 @@ end
5656

5757
function interrupt(proc::Process, cause::Any=nothing)
5858
env = environment(proc)
59-
if !done(proc.fsmi)
59+
if proc.fsmi != 0xff
6060
proc.target isa Initialize && schedule(proc.target; priority=typemax(Int8))
6161
target = schedule(Interrupt(env); priority=typemax(Int8), value=InterruptException(active_process(env), cause))
6262
@callback execute_interrupt(target, proc)

0 commit comments

Comments
 (0)