Skip to content
Snippets Groups Projects
Commit df1285b5 authored by pjs's avatar pjs
Browse files

Terminate with up-front cancel

parent 7d775f99
No related branches found
No related tags found
No related merge requests found
......@@ -13,9 +13,8 @@ class MyModel
def increment(n:, char:)
@x += n
schedule(:increment, 2.0 * rand(2), n: @x, char: char - 1, priority: 3)
printf "%f, %f, %c\n", model_time, @x, char
cancel_all :increment if model_time > 10
schedule(:increment, 2.0 * rand(2), n: @x, char: char - 1, priority: 3)
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment