Remove unnecessary code
A descriptor is always added to the global epoll instance or to a specific worker, never just to _any_ worker.
This commit is contained in:
@ -60,11 +60,6 @@ typedef struct mxs_poll_data
|
||||
*/
|
||||
#define MXS_WORKER_ALL -1
|
||||
|
||||
/**
|
||||
* A file descriptor should be added to the poll set of some worker.
|
||||
*/
|
||||
#define MXS_WORKER_ANY -2
|
||||
|
||||
/**
|
||||
* Add a file descriptor with associated data to the poll set.
|
||||
*
|
||||
|
||||
@ -40,7 +40,6 @@
|
||||
|
||||
using maxscale::Worker;
|
||||
|
||||
static int next_epoll_fd = 0; /*< Which thread handles the next DCB */
|
||||
static int n_threads; /*< Number of threads */
|
||||
|
||||
/**
|
||||
@ -100,13 +99,7 @@ bool poll_add_fd_to_worker(int wid, int fd, uint32_t events, MXS_POLL_DATA* data
|
||||
{
|
||||
bool rv;
|
||||
|
||||
if (wid == MXS_WORKER_ANY)
|
||||
{
|
||||
wid = (int)atomic_add(&next_epoll_fd, 1) % n_threads;
|
||||
|
||||
rv = add_fd_to_worker(wid, fd, events, data);
|
||||
}
|
||||
else if (wid == MXS_WORKER_ALL)
|
||||
if (wid == MXS_WORKER_ALL)
|
||||
{
|
||||
rv = add_fd_to_workers(fd, events, data);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user