diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2024-07-10 15:17:58 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2024-07-10 15:17:58 -0400 |
commit | b032abe2074949074c893153d992ae264c34116a (patch) | |
tree | 9b7c65188ab4abcb7aa6f022438d3b7885c9e834 /indra/newview/scripts/lua | |
parent | 8c94ff566a4f9076607d1b988f3eb7ad7e200bd9 (diff) | |
parent | e26727e03bb02d26b3f0d83f748dbd8eb88e4940 (diff) |
Merge branch 'lua-atexit-run' into lua-no-reuse.
We couldn't discard the "p.s." fiber.run() call from LuaState::expr() until we
could count on fiber.lua's LL.atexit(fiber.run) call being executed after each
Lua script or chunk, and we couldn't count on that until we made
LLLUAmanager::runScriptFile() instantiate and destroy its LuaState on the C++
Lua-specific coroutine. Now that we've done that, use LL.atexit(fiber.run)
instead of the whole special-case "p.s." in LuaState::expr().
Diffstat (limited to 'indra/newview/scripts/lua')
-rw-r--r-- | indra/newview/scripts/lua/require/fiber.lua | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/indra/newview/scripts/lua/require/fiber.lua b/indra/newview/scripts/lua/require/fiber.lua index cae27b936b..b3c684dd67 100644 --- a/indra/newview/scripts/lua/require/fiber.lua +++ b/indra/newview/scripts/lua/require/fiber.lua @@ -337,4 +337,10 @@ function fiber.run() return idle_done end +-- Make sure we finish up with a call to run(). That allows a consuming script +-- to kick off some number of fibers, do some work on the main thread and then +-- fall off the end of the script without explicitly calling fiber.run(). +-- run() ensures the rest of the fibers run to completion (or error). +LL.atexit(fiber.run) + return fiber |