summaryrefslogtreecommitdiff
path: root/indra/llcommon/CMakeLists.txt
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2021-10-07 15:32:51 -0400
committerNat Goodspeed <nat@lindenlab.com>2021-10-07 15:32:51 -0400
commit623ac79120a417ec445ce5c106a907fe46734309 (patch)
treed91b262dae1d4416d71ce78b7089aa1603961dc0 /indra/llcommon/CMakeLists.txt
parent6e06d1db6045df2e4961243f379c4d7695a8190d (diff)
SL-16024: Add LL::WorkQueue for passing work items between threads.
A typical WorkQueue has a string name, which can be used to find it to post work to it. "Work" is a nullary callable. WorkQueue is a multi-producer, multi-consumer thread-safe queue: multiple threads can service the WorkQueue, multiple threads can post work to it. Work can be scheduled in the future by submitting with a timestamp. In addition, a given work item can be scheduled to run on a recurring basis. A requesting thread servicing a WorkQueue of its own, such as the viewer's main thread, can submit work to another WorkQueue along with a callback to be passed the result (of arbitrary type) of the first work item. The callback is posted to the originating WorkQueue, permitting safe data exchange between participating threads. Methods are provided for different kinds of servicing threads. runUntilClose() is useful for a simple worker thread. runFor(duration) devotes no more than a specified time slice to that WorkQueue, e.g. for use by the main thread.
Diffstat (limited to 'indra/llcommon/CMakeLists.txt')
-rw-r--r--indra/llcommon/CMakeLists.txt3
1 files changed, 3 insertions, 0 deletions
diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt
index 5efcfabf24..a3dbb6d9d0 100644
--- a/indra/llcommon/CMakeLists.txt
+++ b/indra/llcommon/CMakeLists.txt
@@ -121,6 +121,7 @@ set(llcommon_SOURCE_FILES
llworkerthread.cpp
timing.cpp
u64.cpp
+ workqueue.cpp
StackWalker.cpp
)
@@ -258,6 +259,7 @@ set(llcommon_HEADER_FILES
timer.h
tuple.h
u64.h
+ workqueue.h
StackWalker.h
)
@@ -363,6 +365,7 @@ if (LL_TESTS)
LL_ADD_INTEGRATION_TEST(stringize "" "${test_libs}")
LL_ADD_INTEGRATION_TEST(threadsafeschedule "" "${test_libs}")
LL_ADD_INTEGRATION_TEST(tuple "" "${test_libs}")
+ LL_ADD_INTEGRATION_TEST(workqueue "" "${test_libs}")
## llexception_test.cpp isn't a regression test, and doesn't need to be run
## every build. It's to help a developer make implementation choices about