MXS-2002 Add additional versions of Worker::[call|execute]()
This commit is contained in:
@ -761,9 +761,25 @@ public:
|
|||||||
*/
|
*/
|
||||||
bool execute(GenericFunction func, Semaphore* pSem, enum execute_mode_t mode);
|
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
|
* Executes a task on the worker thread and returns only when the task
|
||||||
* been executed.
|
* 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 func Function to execute
|
||||||
* @param mode Execution mode
|
* @param mode Execution mode
|
||||||
|
@ -516,6 +516,12 @@ bool Worker::execute(GenericFunction func, Semaphore* pSem, execute_mode_t mode)
|
|||||||
return rval;
|
return rval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Worker::call(Task& task, execute_mode_t mode)
|
||||||
|
{
|
||||||
|
Semaphore sem;
|
||||||
|
return execute(&task, &sem, mode) && sem.wait();
|
||||||
|
}
|
||||||
|
|
||||||
bool Worker::call(GenericFunction func, execute_mode_t mode)
|
bool Worker::call(GenericFunction func, execute_mode_t mode)
|
||||||
{
|
{
|
||||||
Semaphore sem;
|
Semaphore sem;
|
||||||
|
@ -972,7 +972,7 @@ void MariaDBMonitor::disable_setting(const std::string& setting)
|
|||||||
p.name = const_cast<char*>(setting.c_str());
|
p.name = const_cast<char*>(setting.c_str());
|
||||||
p.value = const_cast<char*>("false");
|
p.value = const_cast<char*>("false");
|
||||||
monitor_add_parameters(m_monitor, &p);
|
monitor_add_parameters(m_monitor, &p);
|
||||||
}, NULL, EXECUTE_AUTO);
|
}, EXECUTE_AUTO);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user