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:
parent
4a18ed6778
commit
75e945f162
@ -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 ();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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 &);
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user