MXS-2002 Add additional versions of Worker::[call|execute]()

This commit is contained in:
Johan Wikman
2018-08-09 15:21:01 +03:00
parent e9758ebaf1
commit 4193c4d3db
3 changed files with 25 additions and 3 deletions

View File

@ -761,9 +761,25 @@ public:
*/
bool execute(GenericFunction func, Semaphore* pSem, enum execute_mode_t mode);
bool execute(GenericFunction func, enum execute_mode_t mode)
{
return execute(func, NULL, mode);
}
/**
* Execute function on worker thread and return only when it has
* been executed.
* Executes a task on the worker thread and returns only when the task
* has finished.
*
* @param task The task to be executed.
* @param mode Execution mode
*
* @return True if the task was executed on the worker.
*/
bool call(Task& task, enum execute_mode_t mode);
/**
* Executes function on worker thread and returns only when the function
* has finished.
*
* @param func Function to execute
* @param mode Execution mode