MXS-1506: Combine housekeeper task types

The tasks themselves now control whether they are executed again. To
compare it to the old system, oneshot tasks now return `false` and
repeating tasks return `true`.

Letting the housekeeper remove the tasks makes the code simpler and
removes the possibility of the task being removed while it is being
executed. It does introduce a deadlock possibility if a housekeeper
function is called inside a housekeeper task.
This commit is contained in:
Markus Mäkelä
2018-04-03 15:12:33 +03:00
parent 96a0aae7fe
commit c70216390f
10 changed files with 105 additions and 105 deletions

View File

@ -279,7 +279,7 @@ static int blr_slave_send_columndef_with_status_schema(ROUTER_INSTANCE *router,
int type,
int len,
uint8_t seqno);
static void blr_send_slave_heartbeat(void *inst);
static bool blr_send_slave_heartbeat(void *inst);
static int blr_slave_send_heartbeat(ROUTER_INSTANCE *router,
ROUTER_SLAVE *slave);
static int blr_set_master_ssl(ROUTER_INSTANCE *router,
@ -6099,7 +6099,7 @@ blr_slave_send_columndef_with_status_schema(ROUTER_INSTANCE *router,
* @param router Current router instance
*/
static void
static bool
blr_send_slave_heartbeat(void *inst)
{
ROUTER_SLAVE *sptr = NULL;
@ -6136,6 +6136,8 @@ blr_send_slave_heartbeat(void *inst)
}
spinlock_release(&router->lock);
return true;
}
/**