Skip to content

Commit

Permalink
Merge pull request #3159 from sigiesec/remove-superfluous-mutex
Browse files Browse the repository at this point in the history
Problem: epoll_t employs an unnecessary mutex
  • Loading branch information
bluca committed Jun 7, 2018
2 parents add97ca + 75e945f commit 3a1e8f0
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 7 deletions.
4 changes: 0 additions & 4 deletions src/epoll.cpp
Expand Up @@ -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);
Expand Down Expand Up @@ -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 ();
}
}

Expand Down
3 changes: 0 additions & 3 deletions src/epoll.hpp
Expand Up @@ -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 &);
};
Expand Down

0 comments on commit 3a1e8f0

Please sign in to comment.