summaryrefslogtreecommitdiff
path: root/indra/newview/llsechandler_basic.h
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2024-03-23 17:43:07 +0900
committerNat Goodspeed <nat@lindenlab.com>2024-03-23 17:43:07 +0900
commit2dc003779443db99f46b3db6d17a1954f7b141dd (patch)
treeeb2db6ec9b5cbea3a157033dcd11d23aba2c5911 /indra/newview/llsechandler_basic.h
parentde1fc577666686fb0c3f8b38d8c6c90eb6dff414 (diff)
Make leap.request() work even from Lua's main thread.
Recast fiber.yield() as internal function scheduler(). Move fiber.run() after it so it can call scheduler() as a local function. Add new fiber.yield() that also calls scheduler(); the added value of this new fiber.yield() over plain scheduler() is that if scheduler() returns before the caller is ready (because the configured set_idle() function returned non-nil), it produces an explicit error rather than returning to its caller. So the caller can assume that when fiber.yield() returns normally, the calling fiber is ready. This allows any fiber, including the main thread, to call fiber.yield() or fiber.wait(). This supports using leap.request(), which posts a request and then waits on a WaitForReqid, which calls ErrorQueue:Dequeue(), which calls fiber.wait(). WaitQueue:_wake_waiters() must call fiber.status() instead of coroutine.status() so it understands the special token 'main'. Add a new llluamanager_test.cpp test to exercise calling leap.request() from Lua's main thread.
Diffstat (limited to 'indra/newview/llsechandler_basic.h')
0 files changed, 0 insertions, 0 deletions