Merge branch '2.2' into 2.3

This commit is contained in:
Markus Mäkelä
2019-06-19 10:54:37 +03:00
5 changed files with 33 additions and 18 deletions

View File

@ -111,7 +111,7 @@ uint64_t WorkerLoad::get_time_ms()
int rv = clock_gettime(CLOCK_MONOTONIC_COARSE, &t);
if (rv != 0)
{
mxb_assert(errno == EINVAL); // CLOCK_MONOTONIC_COARSE not supported.
mxb_assert(errno == EINVAL); // CLOCK_MONOTONIC_COARSE not supported.
rv = clock_gettime(CLOCK_MONOTONIC, &t);
mxb_assert(rv == 0);
}
@ -519,9 +519,19 @@ bool Worker::call(function<void ()> func, execute_mode_t mode)
bool Worker::post_message(uint32_t msg_id, intptr_t arg1, intptr_t arg2)
{
// NOTE: No logging here, this function must be signal safe.
MessageQueue::Message message(msg_id, arg1, arg2);
bool rval = false;
return m_pQueue->post(message);
// TODO: Enable and fix this in develop and/or 2.4: The deletion of rworker_local is done after the
// workers have stopped and it triggers this assertion.
// mxb_assert(state() != Worker::STOPPED);
if (state() != Worker::STOPPED)
{
MessageQueue::Message message(msg_id, arg1, arg2);
rval = m_pQueue->post(message);
}
return rval;
}
void Worker::run(mxb::Semaphore* pSem)