summaryrefslogtreecommitdiff
path: root/indra/newview/llluamanager.h
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2024-04-17 16:39:37 -0400
committerNat Goodspeed <nat@lindenlab.com>2024-04-17 16:39:37 -0400
commitc78be38a6a4211f06876bc80b3f19f89a5f936e0 (patch)
tree1f8d33f1995356e8c3c057d94d15661e5fc70ecd /indra/newview/llluamanager.h
parente96f2926544e7f56eec0cc0ce66ea9e3e1e80eb9 (diff)
Reintroduce LLCoros::killreq() to request killing a named coroutine.
Make LLCoros constructor echo "LLApp" status-change events on new "LLCoros" event pump. Rename LLCoros::kill() to killreq() because this operation only registers a request for the named coroutine to terminate next time it calls checkStop(). Add a new CoroData member to record the name of the coroutine requesting termination. killreq() sets that and also posts "killreq" to "LLCoros". Add an optional final-cleanup callback to LLCoros::checkStop(). Make checkStop() check for a pending killreq() request as well as viewer termination. Introduce new LLCoros::Killed exception for that case. Introduce LLCoros::getStopListener(), with two overloads, to encapsulate some of the messy logic to listen (perhaps temporarily) for viewer shutdown. Both overloads are for use by code at the source end of a queue or promise or other resource for which coroutines might still be waiting at viewer shutdown time. One overload is specifically for when the caller knows the name of the one and only coroutine that will wait on the resource (e.g. because the caller IS that coroutine). That overload honors killreq(). Use getStopListener() to simplify the four existing places where we set up such a listener. Add a fifth: also make WorkQueue listen for viewer shutdown (resolving a TODO comment). Remove LLLUAmanager::terminateScript(), getTerminationList() and the static sTerminationList. In the Lua interrupt callback, instead of checking sTerminationList, call LLCoros::checkStop(). Change LLFloaterLUAScripts terminate-script logic to call LLCoros::killreq() instead of posting on "LLLua" and calling LLLUAmanager::terminateScript(). Drop LLApp::setStatus() posting to "LLLua" LLEventPump: the above makes that moot.
Diffstat (limited to 'indra/newview/llluamanager.h')
-rw-r--r--indra/newview/llluamanager.h3
1 files changed, 0 insertions, 3 deletions
diff --git a/indra/newview/llluamanager.h b/indra/newview/llluamanager.h
index d671719bc4..af9dcf70c2 100644
--- a/indra/newview/llluamanager.h
+++ b/indra/newview/llluamanager.h
@@ -85,12 +85,9 @@ public:
static void runScriptOnLogin();
static const std::map<std::string, std::string> getScriptNames() { return sScriptNames; }
- static std::set<std::string> getTerminationList() { return sTerminationList; }
- static void terminateScript(std::string& coro_name) { sTerminationList.insert(coro_name); }
private:
static std::map<std::string, std::string> sScriptNames;
- static std::set<std::string> sTerminationList;
};
class LLRequireResolver