diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2024-03-25 16:57:28 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2024-03-25 16:57:28 -0400 |
commit | 98e6356aed0c757f16267cc2ae921f9c90a249fe (patch) | |
tree | 93a3f25ff650a50c594dd1c09c7fff267c1f9379 /indra/llcommon | |
parent | ac4fa418e3a7402f9d9122c726d2fbfc4b8767b2 (diff) |
Add LL.check_stop() entry point and call it in fiber scheduler().
fiber.lua's scheduler() is greedy, in the sense that it wants to run every
ready Lua fiber before retrieving the next incoming event from the viewer (and
possibly blocking for some real time before it becomes available). But check
for viewer shutdown before resuming any suspended-but-ready Lua fiber.
Diffstat (limited to 'indra/llcommon')
-rw-r--r-- | indra/llcommon/lua_function.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/indra/llcommon/lua_function.cpp b/indra/llcommon/lua_function.cpp index 962e9ee2fa..9f0abd5674 100644 --- a/indra/llcommon/lua_function.cpp +++ b/indra/llcommon/lua_function.cpp @@ -682,6 +682,15 @@ std::pair<LuaFunction::Registry&, LuaFunction::Lookup&> LuaFunction::getState() } /***************************************************************************** +* check_stop() +*****************************************************************************/ +lua_function(check_stop, "ensure that a Lua script responds to viewer shutdown") +{ + LLCoros::checkStop(); + return 0; +} + +/***************************************************************************** * help() *****************************************************************************/ lua_function(help, |