From 4829b896f790b3d9439cbcf19b5580d4a8e52112 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Fri, 7 Oct 2016 17:18:46 -0400 Subject: [PATCH] Documented the async task queue. --- Concurrency/AsyncTaskQueue.hpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Concurrency/AsyncTaskQueue.hpp b/Concurrency/AsyncTaskQueue.hpp index 5cb14125f..6d06f2264 100644 --- a/Concurrency/AsyncTaskQueue.hpp +++ b/Concurrency/AsyncTaskQueue.hpp @@ -16,13 +16,29 @@ namespace Concurrency { +/*! + An async task queue allows a caller to enqueue void(void) functions. Those functions are guaranteed + to be performed serially and asynchronously from the caller. A caller may also request to synchronise, + causing it to block until all previously-enqueued functions are complete. +*/ class AsyncTaskQueue { public: AsyncTaskQueue(); ~AsyncTaskQueue(); + /*! + Adds @c function to the queue. + + @discussion Functions will be performed serially and asynchronously. This method is safe to + call from multiple threads. + @parameter function The function to enqueue. + */ void enqueue(std::function function); + + /*! + Blocks the caller until all previously-enqueud functions have completed. + */ void synchronise(); private: