Merge branch '2.3' into develop

This commit is contained in:
Markus Mäkelä
2019-06-19 13:28:58 +03:00
7 changed files with 84 additions and 42 deletions

View File

@ -42,17 +42,18 @@ struct WORKER_STATISTICS
N_QUEUE_TIMES = 30
};
int64_t n_read = 0; /*< Number of read events */
int64_t n_write = 0; /*< Number of write events */
int64_t n_error = 0; /*< Number of error events */
int64_t n_hup = 0; /*< Number of hangup events */
int64_t n_accept = 0; /*< Number of accept events */
int64_t n_polls = 0; /*< Number of poll cycles */
int64_t n_pollev = 0; /*< Number of polls returning events */
int64_t evq_avg = 0; /*< Average event queue length */
int64_t evq_max = 0; /*< Maximum event queue length */
int64_t maxqtime = 0;
int64_t maxexectime = 0;
int64_t n_read = 0; /*< Number of read events */
int64_t n_write = 0; /*< Number of write events */
int64_t n_error = 0; /*< Number of error events */
int64_t n_hup = 0; /*< Number of hangup events */
int64_t n_accept = 0; /*< Number of accept events */
int64_t n_polls = 0; /*< Number of poll cycles */
int64_t n_pollev = 0; /*< Number of polls returning events */
int64_t evq_avg = 0; /*< Average event queue length */
int64_t evq_max = 0; /*< Maximum event queue length */
int64_t maxqtime = 0;
int64_t maxexectime = 0;
std::array<int64_t, MAXNFDS> n_fds {}; /*< Number of wakeups with particular n_fds value */
std::array<uint32_t, N_QUEUE_TIMES + 1> qtimes {};
std::array<uint32_t, N_QUEUE_TIMES + 1> exectimes {};

View File

@ -523,9 +523,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)