Add a TaskQueue that can serialize work on a ThreadPool.
authorZachary Turner <zturner@google.com>
Mon, 25 Jun 2018 03:13:09 +0000 (03:13 +0000)
committerZachary Turner <zturner@google.com>
Mon, 25 Jun 2018 03:13:09 +0000 (03:13 +0000)
commit35169f66988223c2b44e211fe10e21c6ac3e7ddc
tree1e3fad7d006b994974f86e2de27e731c9290e386
parent04c48949116d2e3407f76856476c00417abdb076
Add a TaskQueue that can serialize work on a ThreadPool.

We have ThreadPool, which can execute work asynchronously on N
background threads, but sometimes you need to make sure the work
is executed asynchronously but also serially.  That is, if task
B is enqueued after task A, then task B should not begin until
task A has completed.  This patch adds such a class.

Differential Revision: https://reviews.llvm.org/D48240

llvm-svn: 335440
llvm/include/llvm/Support/TaskQueue.h [new file with mode: 0644]
llvm/unittests/Support/CMakeLists.txt
llvm/unittests/Support/TaskQueueTest.cpp [new file with mode: 0644]