0
0
mirror of https://github.com/zeromq/libzmq.git synced 2024-12-29 00:32:34 +08:00

Problem: epoll_t employs an unnecessary mutex

Solution: remove the mutex
This commit is contained in:
Simon Giesecke 2018-06-06 21:41:16 +02:00
parent 4a18ed6778
commit 75e945f162
2 changed files with 0 additions and 7 deletions

View File

@ -112,9 +112,7 @@ void zmq::epoll_t::rm_fd (handle_t handle_)
int rc = epoll_ctl (_epoll_fd, EPOLL_CTL_DEL, pe->fd, &pe->ev);
errno_assert (rc != -1);
pe->fd = retired_fd;
_retired_sync.lock ();
_retired.push_back (pe);
_retired_sync.unlock ();
// Decrease the load metric of the thread.
adjust_load (-1);
@ -209,13 +207,11 @@ void zmq::epoll_t::loop ()
}
// Destroy retired event sources.
_retired_sync.lock ();
for (retired_t::iterator it = _retired.begin (); it != _retired.end ();
++it) {
LIBZMQ_DELETE (*it);
}
_retired.clear ();
_retired_sync.unlock ();
}
}

View File

@ -106,9 +106,6 @@ class epoll_t : public worker_poller_base_t
// Handle of the physical thread doing the I/O work.
thread_t _worker;
// Synchronisation of retired event sources
mutex_t _retired_sync;
epoll_t (const epoll_t &);
const epoll_t &operator= (const epoll_t &);
};