Hello
I have a thread/function A blocked, waiting for StringValue:Changed:Wait() event to fire.
Then in another thread/function B the given Value is changed. However the control is immediately transferred to the waiting function A before function B finishes.
This is unexpected to me and a possible cause of problems because lines of code which are supposed to be executed together in function B are now interrupted by other code in a different thread.
(I am not even sure when the control will be returned again to thread B, will it be placed at the end of the task scheduler queue…)
How do you handle this and what is the correct approach?
Thanks