MXS-1915 Replace worker id with worker pointer

To get rid of the need that a Worker must have an id, we store
in the MXS_POLL_DATA structure a pointer to the owning worker
instead of the id of the owning worker. This also allows some
further cleanup as the need for switching back and forth between
the id and the worker disappears.

The id will be moved from Worker to RoutingWorker as there
currently is a fair amount of code that assumes that the id of
routing workers start from 0.
This commit is contained in:
Johan Wikman
2018-06-20 14:54:20 +03:00
parent 241c9b645d
commit 86b5238aaf
8 changed files with 73 additions and 66 deletions

View File

@ -211,7 +211,7 @@ static void blr_start_master(void* data)
* 'client' is the fake DCB that emulates a client session:
* we need to set the poll.thread.id for the "dummy client"
*/
client->session->client_dcb->poll.thread.id = mxs_rworker_get_current_id();
client->session->client_dcb->poll.owner = mxs_rworker_get_current();
/* Connect to configured master server */
if ((router->master = dcb_connect(router->service->dbref->server,