(notonline)-->
without js -- (file i/o)
integer fn = open("log.txt","u"),
...
integer count = 0
while not lock_file(fn,LOCK_SHARED,{}) do
--while not lock_file(fn,LOCK_EXCLUSIVE,{}) do
sleep(1)
count += 1
if count>5 then
-- message/abort/retry/...
end if
end while
...
unlock_file(fn,{})
...
close(fn)