summaryrefslogtreecommitdiff
path: root/indra/llcommon/llevents.h
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2024-03-22 21:04:48 +0900
committerNat Goodspeed <nat@lindenlab.com>2024-03-22 21:04:48 +0900
commitbb39a8b223f78205a10ffcb61e3b3bfe05b3fd1a (patch)
tree77beefb75440e9016a44adfa872227f3790ce3b2 /indra/llcommon/llevents.h
parent0566af988790e95414ed18cd82206710094d8fae (diff)
Fix a couple bugs in fiber.lua machinery.
This fixes a hang if the Lua script explicitly calls fiber.run() before LuaState::expr()'s implicit fiber.run() call. Make fiber.run() remove the calling fiber from the ready list to avoid an infinite loop when all other fibers have terminated: "You're ready!" "Okay, yield()." "You're ready again!" ... But don't claim it's waiting, either, because then when all other fibers have terminated, we'd call idle() in the vain hope that something would make that one last fiber ready. WaitQueue:_wake_waiters() needs to wake waiting fibers if the queue's not empty OR it's been closed. Introduce leap.WaitFor:close() to close the queue gracefully so that a looping waiter can terminate, instead of using WaitFor:exception(), which stops the whole script once it propagates. Make leap's cleanup() function call close(). Streamline fiber.get_name() by using 'or' instead of if ... then. Streamline fiber.status() and fiber.set_waiting() by using table.find() instead of a loop.
Diffstat (limited to 'indra/llcommon/llevents.h')
0 files changed, 0 insertions, 0 deletions