14#include <AUI/Thread/AMutex.h>
15#include <AUI/Common/AQueue.h>
25 void operator<<(std::function<
void()>
function) {
26 std::unique_lock lock(mLock);
27 mQueue << std::move(
function);
31 std::unique_lock l(mLock);
32 while (!mQueue.empty()) {
33 auto f = std::move(mQueue.front());
42 bool empty()
noexcept {
43 std::unique_lock l(mLock);
44 return mQueue.empty();
49 AQueue<std::function<void()>> mQueue;
Thread-safe implementation of function queue.
Definition: AFunctionQueue.h:21
A std::queue with AUI extensions.
Definition: AQueue.h:24
Basic syscall-based synchronization primitive.
Definition: AMutex.h:33