Make Worker::run(mxb::Semaphore*) private
The semaphore is only used when Worker::start() is called to synchronize the startup of the two threads. Also asserted that the state is what we expected it to be.
This commit is contained in:
@ -672,10 +672,11 @@ public:
|
|||||||
* The worker will run the poll loop, until it is told to shut down.
|
* The worker will run the poll loop, until it is told to shut down.
|
||||||
*
|
*
|
||||||
* @attention This function will run in the calling thread.
|
* @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.
|
* Run worker in separate thread.
|
||||||
@ -1195,6 +1196,8 @@ private:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void run(mxb::Semaphore* pSem);
|
||||||
|
|
||||||
typedef DelegatingTimer<Worker> PrivateTimer;
|
typedef DelegatingTimer<Worker> PrivateTimer;
|
||||||
typedef std::multimap<int64_t, DelayedCall*> DelayedCallsByTime;
|
typedef std::multimap<int64_t, DelayedCall*> DelayedCallsByTime;
|
||||||
typedef std::unordered_map<uint32_t, DelayedCall*> DelayedCallsById;
|
typedef std::unordered_map<uint32_t, DelayedCall*> DelayedCallsById;
|
||||||
|
@ -529,6 +529,7 @@ bool Worker::post_message(uint32_t msg_id, intptr_t arg1, intptr_t arg2)
|
|||||||
|
|
||||||
void Worker::run(mxb::Semaphore* pSem)
|
void Worker::run(mxb::Semaphore* pSem)
|
||||||
{
|
{
|
||||||
|
ss_dassert(m_state == STOPPED);
|
||||||
this_thread.pCurrent_worker = this;
|
this_thread.pCurrent_worker = this;
|
||||||
|
|
||||||
if (pre_run())
|
if (pre_run())
|
||||||
|
Reference in New Issue
Block a user