MXS-1392 Re-introduce zombie queue

- Extend Worker interface so that zombies can be registered
- Call deletion function at the end of event loop
This commit is contained in:
Johan Wikman
2017-09-08 10:04:37 +03:00
parent be94066b77
commit 8414ce6e80
2 changed files with 32 additions and 3 deletions

View File

@ -836,6 +836,19 @@ json_t* mxs_worker_list_to_json(const char* host)
return task.resource();
}
void Worker::register_zombie(DCB* pDcb)
{
ss_dassert(pDcb->poll.thread.id == m_id);
m_zombies.push_back(pDcb);
}
void Worker::delete_zombies()
{
// TODO: for_each(m_zombies.begin(), m_zombies.end(), dcb_free_all_memory);
m_zombies.resize(0);
}
void Worker::run()
{
this_thread.current_worker_id = m_id;
@ -1227,6 +1240,8 @@ void Worker::poll_waitevents()
m_state = ZPROCESSING;
delete_zombies();
m_state = IDLE;
} /*< while(1) */