From 75e945f162e57d9eda26d4820f34cd25d1caa6da Mon Sep 17 00:00:00 2001 From: Simon Giesecke Date: Wed, 6 Jun 2018 21:41:16 +0200 Subject: [PATCH] Problem: epoll_t employs an unnecessary mutex Solution: remove the mutex --- src/epoll.cpp | 4 ---- src/epoll.hpp | 3 --- 2 files changed, 7 deletions(-) diff --git a/src/epoll.cpp b/src/epoll.cpp index 91173c51..d761b893 100644 --- a/src/epoll.cpp +++ b/src/epoll.cpp @@ -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 (); } } diff --git a/src/epoll.hpp b/src/epoll.hpp index 9d16e147..7958a050 100644 --- a/src/epoll.hpp +++ b/src/epoll.hpp @@ -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 &); };