summaryrefslogtreecommitdiff
path: root/indra/llcommon/llmainthreadtask.h
AgeCommit message (Collapse)Author
2023-09-12DRTVWR-588: Reimplement LLMainThreadTask based on WorkQueueNat Goodspeed
instead of on LLEventTimer. LLEventTimer takes cycles from the main loop to run through the collection of pending LLEventTimers, checking each to see if we've reached its timestamp. But LLMainThreadTask does not require delay timing; it wants the main loop to service it ASAP. That's what the "mainloop" WorkQueue is for. But WorkQueue::waitForResult() forbids calls from a thread's default coroutine. While that restriction may still make sense in general, we specifically want to be able to pause LLMainThreadTask's caller, no matter what coroutine it's running on. Introduce WorkQueue::waitForResult_() that bypasses the check.
2020-03-25DRTVWR-494: Remove LLMainThreadTask::dispatch(LockStatic&, ...)Nat Goodspeed
Monty's code review reveals that conflating dispatch() with [un]lock functionality is inconsistent and unnecessary.
2020-03-25DRTVWR-494: Document LLMainThreadTask class.Nat Goodspeed
2020-03-25DRTVWR-494: Add LLMainThreadTask to perform work on the main thread.Nat Goodspeed
If already running on the main thread, LLMaintThreadTask simply runs the work inline. Otherwise it queues it for the main thread using LLEventTimer, using std::future to retrieve the result.