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:
@ -49,10 +49,7 @@ typedef uint32_t (*mxs_poll_handler_t)(struct mxs_poll_data* data, int wid, uint
|
||||
typedef struct mxs_poll_data
|
||||
{
|
||||
mxs_poll_handler_t handler; /*< Handler for this particular kind of mxs_poll_data. */
|
||||
struct
|
||||
{
|
||||
int id; /*< The id of the worker thread. */
|
||||
} thread;
|
||||
void* owner; /*< Owning worker. */
|
||||
} MXS_POLL_DATA;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user