diff --git a/include/maxscale/worker.hh b/include/maxscale/worker.hh index de5801607..d6fc21bcb 100644 --- a/include/maxscale/worker.hh +++ b/include/maxscale/worker.hh @@ -672,10 +672,11 @@ public: * The worker will run the poll loop, until it is told to shut down. * * @attention This function will run in the calling thread. - * - * @param pSem Semaphore that is posted on once the thread has started */ - void run(mxb::Semaphore* pSem = NULL); + void run() + { + run(nullptr); + } /** * Run worker in separate thread. @@ -1195,6 +1196,8 @@ private: } }; + void run(mxb::Semaphore* pSem); + typedef DelegatingTimer PrivateTimer; typedef std::multimap DelayedCallsByTime; typedef std::unordered_map DelayedCallsById; diff --git a/server/core/worker.cc b/server/core/worker.cc index 3fb008040..ef18299c2 100644 --- a/server/core/worker.cc +++ b/server/core/worker.cc @@ -529,6 +529,7 @@ bool Worker::post_message(uint32_t msg_id, intptr_t arg1, intptr_t arg2) void Worker::run(mxb::Semaphore* pSem) { + ss_dassert(m_state == STOPPED); this_thread.pCurrent_worker = this; if (pre_run())