Suppose I have the following code:
local tab = {}
local function foo()
-- I realize table.insert can be used here
tab[#tab + 1] = 1
...
-- Some non-yield function calls
...
end
I want all calls to the function foo to be synchronized in that no two calls to foo overlap at any point in time. Is it safe to assume that the Roblox thread scheduler will handle this synchronization automatically? If not, is there a way to create some kind of mutex lock to guarantee such synchronization?
