Run Function Atomically
... = atomic.execute(fn, ...)
Runs the function fn
atomically.
Uses atomic.lock and atomic.unlock to wrap the function call.
Exactly the same as:
function atomic.execute(fn, ...)
if not fn then return end
atomic.lock()
local args = { fn(...) }
atomic.unlock()
return unpack(args)
end
The function fn
must complete within 1 second - otherwise the thread will be terminated!