-
-
Notifications
You must be signed in to change notification settings - Fork 415
Fix concurrent do-while instances only running do section once
#8263
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
base: dev/patch
Are you sure you want to change the base?
Conversation
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.
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 |
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.
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