Merge pull request #3159 from sigiesec/remove-superfluous-mutex

Problem: epoll_t employs an unnecessary mutex
This commit is contained in:
Luca Boccassi 2018-06-07 14:17:20 +01:00 committed by GitHub
commit 3a1e8f0704
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 &);
};