MXS-1754 Rename mxs::Worker to mxs::RoutingWorker
A new class mxs::Worker will be introduced and mxs::RoutingWorker will be inherited from that. mxs::Worker will basically only be a thread with a message-loop. Once available, all current non-worker threads (but the one implicitly created by microhttpd) can be creating by inheriting from that; in practice that means the housekeeping thread, all monitor threads and possibly the logging thread. The benefit of this arrangement is that there then will be a general mechanism for cross thread communication without having to use any shared data structures.
This commit is contained in:
@ -18,7 +18,7 @@
|
||||
#include <unistd.h>
|
||||
#include <maxscale/debug.h>
|
||||
#include <maxscale/log_manager.h>
|
||||
#include "internal/worker.hh"
|
||||
#include "internal/routingworker.hh"
|
||||
|
||||
namespace
|
||||
{
|
||||
@ -165,7 +165,7 @@ bool MessageQueue::post(const Message& message) const
|
||||
return rv;
|
||||
}
|
||||
|
||||
bool MessageQueue::add_to_worker(Worker* pWorker)
|
||||
bool MessageQueue::add_to_worker(RoutingWorker* pWorker)
|
||||
{
|
||||
if (m_pWorker)
|
||||
{
|
||||
@ -181,9 +181,9 @@ bool MessageQueue::add_to_worker(Worker* pWorker)
|
||||
return m_pWorker != NULL;
|
||||
}
|
||||
|
||||
Worker* MessageQueue::remove_from_worker()
|
||||
RoutingWorker* MessageQueue::remove_from_worker()
|
||||
{
|
||||
Worker* pWorker = m_pWorker;
|
||||
RoutingWorker* pWorker = m_pWorker;
|
||||
|
||||
if (m_pWorker)
|
||||
{
|
||||
|
Reference in New Issue
Block a user