MXS-2008 Remove MXS_WORKER_MSG_PING
No reason for including that in the worker interface.
This commit is contained in:
@ -22,15 +22,6 @@ typedef struct mxs_worker
|
|||||||
|
|
||||||
enum mxs_worker_msg_id
|
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.
|
* Shutdown message.
|
||||||
*
|
*
|
||||||
|
@ -610,16 +610,6 @@ void Worker::handle_message(MessageQueue& queue, const MessageQueue::Message& ms
|
|||||||
{
|
{
|
||||||
switch (msg.id())
|
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:
|
case MXS_WORKER_MSG_SHUTDOWN:
|
||||||
{
|
{
|
||||||
MXS_INFO("Worker %p received shutdown message.", this);
|
MXS_INFO("Worker %p received shutdown message.", this);
|
||||||
|
@ -907,9 +907,21 @@ static void cmd_AddServer(DCB *dcb, SERVER *server, char *v1, char *v2, char *v3
|
|||||||
/**
|
/**
|
||||||
* The subcommands of the ping command.
|
* 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)
|
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);
|
dcb_printf(dcb, "Broadcasted ping message to %d workers.\n", n);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user