Fix concurrent do-while instances only running do section once#8263
Fix concurrent do-while instances only running do section once#8263
do-while instances only running do section once#8263Conversation
sovdeeth
left a comment
There was a problem hiding this comment.
Waiter! Waiter! More tests please!
I didn't know how to do tests for this since iirc you can't have delays in tests |
|
Just have a function with a do while, call the function twice |
APickledWalrus
left a comment
There was a problem hiding this comment.
Should be okay with sovde's suggestion.
That won't properly test it, because without a delay the second loop will only run after the first function call has finished execution. As seen here: function test(id: text):
do while {_a} < 20:
broadcast {_id}
add 1 to {_a}
on load:
test("1")
test("2") |
|
Yeah but can't you have the delay exist but not rely on it finishing? Eg And just ensure the {} = number of times func is called |
Problem
If two or more
do-whilecalls of the same instance happen at the same time, thedosection only works properly for the first one.Solution
Use a set to track which events have run the
dosection instead of a single boolean variableTesting Completed
Manual testing
Supporting Information
N/A
Completes: #8262
Related: none