summaryrefslogtreecommitdiff
path: root/indra/llcommon
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2026-01-29 14:43:23 +0800
committerErik Kundiman <erik@megapahit.org>2026-01-29 14:43:23 +0800
commitdbe9c9c1929cfb345f9363e4ba1cb4128188d2f3 (patch)
treee97d3f034dc68c68af99034765683c58c771f6d3 /indra/llcommon
parent4644df66c9f210c8cda81ae63e4c6a6b7ebece9f (diff)
parente42ec63bfd7ada1087a00ca3ccc39c95679b7fab (diff)
Merge tag 'Second_Life_Release#e42ec63b-2026.01' into 2026.01
Diffstat (limited to 'indra/llcommon')
-rw-r--r--indra/llcommon/lleventcoro.cpp12
-rw-r--r--indra/llcommon/lleventcoro.h5
2 files changed, 17 insertions, 0 deletions
diff --git a/indra/llcommon/lleventcoro.cpp b/indra/llcommon/lleventcoro.cpp
index e1fc4764f6..bb2cd4fb2e 100644
--- a/indra/llcommon/lleventcoro.cpp
+++ b/indra/llcommon/lleventcoro.cpp
@@ -137,6 +137,18 @@ void llcoro::suspendUntilTimeout(float seconds)
suspendUntilEventOnWithTimeout(bogus, seconds, timedout);
}
+void llcoro::suspendUntilNextFrame()
+{
+ LLCoros::checkStop();
+ LLCoros::TempStatus st("waiting for next frame");
+
+ // Listen for the next event on the "mainloop" event pump.
+ // Once per frame we get mainloop.post(newFrame);
+ LLEventPumpOrPumpName mainloop_pump("mainloop");
+ // Wait for the next event (the event data is ignored).
+ suspendUntilEventOn(mainloop_pump);
+}
+
namespace
{
diff --git a/indra/llcommon/lleventcoro.h b/indra/llcommon/lleventcoro.h
index 492563bb98..25a8a98e36 100644
--- a/indra/llcommon/lleventcoro.h
+++ b/indra/llcommon/lleventcoro.h
@@ -85,6 +85,11 @@ void suspend();
void suspendUntilTimeout(float seconds);
/**
+ * Yield control from a coroutine until the next mainloop's newFrame event.
+ */
+void suspendUntilNextFrame();
+
+/**
* Post specified LLSD event on the specified LLEventPump, then suspend for a
* response on specified other LLEventPump. This is more than mere
* convenience: the difference between this function and the sequence