From 241c9b645d795a85913ba54af1e1aaa6552637a4 Mon Sep 17 00:00:00 2001 From: Johan Wikman Date: Wed, 20 Jun 2018 11:31:02 +0300 Subject: [PATCH] MXS-1915 Remove unused functions --- include/maxscale/worker.h | 46 ----------------------------------- server/core/internal/worker.h | 9 ------- server/core/routingworker.cc | 5 ---- server/core/worker.cc | 25 ------------------- 4 files changed, 85 deletions(-) diff --git a/include/maxscale/worker.h b/include/maxscale/worker.h index 851ee757f..219bd474d 100644 --- a/include/maxscale/worker.h +++ b/include/maxscale/worker.h @@ -51,25 +51,6 @@ enum mxs_worker_msg_id MXS_WORKER_MSG_CALL }; -/** - * Return the worker associated with the provided worker id. - * - * @param worker_id A worker id. - * - * @return The corresponding worker instance, or NULL if the id does - * not correspond to a worker. - */ -MXS_WORKER* mxs_worker_get(int worker_id); - -/** - * Return the id of the worker. - * - * @param worker A worker. - * - * @return The id of the worker. - */ -int mxs_worker_id(MXS_WORKER* pWorker); - /** * Return the current worker. * @@ -77,13 +58,6 @@ int mxs_worker_id(MXS_WORKER* pWorker); */ MXS_WORKER* mxs_worker_get_current(); -/** - * Return the id of the worker. - * - * @return The id of the worker, or -1 if there is no current worker. - */ -int mxs_worker_get_current_id(); - /** * Post a message to a worker. * @@ -102,26 +76,6 @@ int mxs_worker_get_current_id(); */ bool mxs_worker_post_message(MXS_WORKER* worker, uint32_t msg_id, intptr_t arg1, intptr_t arg2); -/** - * Broadcast a message to all worker. - * - * @param msg_id The message id. - * @param arg1 Message specific first argument. - * @param arg2 Message specific second argument. - * - * @return The number of messages posted; if less that ne number of workers - * then some postings failed. - * - * @attention The return value tells *only* whether message could be posted, - * *not* that it has reached the worker. - * - * @attentsion Exactly the same arguments are passed to all workers. Take that - * into account if the passed data must be freed. - * - * @attention This function is signal safe. - */ -size_t mxs_worker_broadcast_message(uint32_t msg_id, intptr_t arg1, intptr_t arg2); - /** * @brief Convert a worker to JSON format * diff --git a/server/core/internal/worker.h b/server/core/internal/worker.h index 6874e3cd9..4280f02ba 100644 --- a/server/core/internal/worker.h +++ b/server/core/internal/worker.h @@ -16,13 +16,4 @@ MXS_BEGIN_DECLS -/** - * Query whether worker should shutdown. - * - * @param worker The worker in question. - * - * @return True, if the worker should shut down, false otherwise. - */ -bool mxs_worker_should_shutdown(MXS_WORKER* worker); - MXS_END_DECLS diff --git a/server/core/routingworker.cc b/server/core/routingworker.cc index 25d050b04..f50531aec 100644 --- a/server/core/routingworker.cc +++ b/server/core/routingworker.cc @@ -333,11 +333,6 @@ bool RoutingWorker::remove_shared_fd(int fd) return rv; } -int mxs_worker_id(MXS_WORKER* pWorker) -{ - return static_cast(pWorker)->id(); -} - bool mxs_worker_should_shutdown(MXS_WORKER* pWorker) { return static_cast(pWorker)->should_shutdown(); diff --git a/server/core/worker.cc b/server/core/worker.cc index 810c4047e..cef585ba6 100644 --- a/server/core/worker.cc +++ b/server/core/worker.cc @@ -1395,36 +1395,11 @@ json_t* mxs_worker_list_to_json(const char* host) return task.resource(); } -size_t mxs_worker_broadcast_message(uint32_t msg_id, intptr_t arg1, intptr_t arg2) -{ - return Worker::broadcast_message(msg_id, arg1, arg2); -} - -MXS_WORKER* mxs_worker_get(int worker_id) -{ - return Worker::get(worker_id); -} - MXS_WORKER* mxs_worker_get_current() { return Worker::get_current(); } -int mxs_worker_get_current_id() -{ - return Worker::get_current_id(); -} - -int mxs_worker_id(MXS_WORKER* pWorker) -{ - return static_cast(pWorker)->id(); -} - -bool mxs_worker_should_shutdown(MXS_WORKER* pWorker) -{ - return static_cast(pWorker)->should_shutdown(); -} - bool mxs_worker_post_message(MXS_WORKER* pWorker, uint32_t msg_id, intptr_t arg1, intptr_t arg2) { return static_cast(pWorker)->post_message(msg_id, arg1, arg2);