Allow serial execution of worker tasks

The Worker::execute_on_all_wait is intended to be used with dcb_foreach
which expects a single-threaded context for its function.
This commit is contained in:
Markus Mäkelä
2017-04-24 16:07:42 +03:00
parent ea39b15bbb
commit 963ff0216d
2 changed files with 34 additions and 0 deletions

View File

@ -320,6 +320,21 @@ public:
*/
static size_t execute_on_all(std::auto_ptr<DisposableTask> sTask);
/**
* Executes a task on all workers in serial mode.
*
* The task is executed on at most one worker thread at a time.
*
* @param pTask The task to be executed.
*
* @return How many workers the task was posted to.
*
* @warning This function is extremely inefficient and will be slow compared
* to the other functions. Only use this function when printing thread-specific
* data to stdout.
*/
static size_t execute_on_all_serially(Task* pTask);
/**
* Post a message to a worker.
*