MXS-2008 Remove MXS_WORKER_MSG_PING

No reason for including that in the worker interface.
This commit is contained in:
Johan Wikman 2018-08-13 14:42:33 +03:00
parent 363750a07c
commit 2d1e91ebf4
3 changed files with 13 additions and 20 deletions

View File

@ -22,15 +22,6 @@ typedef struct mxs_worker
enum mxs_worker_msg_id
{
/**
* Ping message.
*
* arg1: 0
* arg2: NULL or pointer to dynamically allocated NULL-terminated string,
* to be freed by worker.
*/
MXS_WORKER_MSG_PING,
/**
* Shutdown message.
*

View File

@ -610,16 +610,6 @@ void Worker::handle_message(MessageQueue& queue, const MessageQueue::Message& ms
{
switch (msg.id())
{
case MXS_WORKER_MSG_PING:
{
ss_dassert(msg.arg1() == 0);
char* zArg2 = reinterpret_cast<char*>(msg.arg2());
const char* zMessage = zArg2 ? zArg2 : "Alive and kicking";
MXS_NOTICE("Worker[%p]: %s.", this, zMessage);
MXS_FREE(zArg2);
}
break;
case MXS_WORKER_MSG_SHUTDOWN:
{
MXS_INFO("Worker %p received shutdown message.", this);

View File

@ -907,9 +907,21 @@ static void cmd_AddServer(DCB *dcb, SERVER *server, char *v1, char *v2, char *v3
/**
* The subcommands of the ping command.
*/
namespace
{
void ping(MXS_WORKER* worker, void* arg)
{
MXS_NOTICE("Worker[%p]: Alive and kicking.", worker);
}
}
void ping_workers(DCB* dcb)
{
int n = mxs_rworker_broadcast_message(MXS_WORKER_MSG_PING, 0, 0);
intptr_t arg1 = reinterpret_cast<intptr_t>(ping);
int n = mxs_rworker_broadcast_message(MXS_WORKER_MSG_CALL, arg1, 0);
dcb_printf(dcb, "Broadcasted ping message to %d workers.\n", n);
}