mirror of
https://github.com/zeromq/libzmq.git
synced 2025-01-19 16:56:11 +01:00
Merge pull request #3159 from sigiesec/remove-superfluous-mutex
Problem: epoll_t employs an unnecessary mutex
This commit is contained in:
commit
3a1e8f0704
@ -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);
|
int rc = epoll_ctl (_epoll_fd, EPOLL_CTL_DEL, pe->fd, &pe->ev);
|
||||||
errno_assert (rc != -1);
|
errno_assert (rc != -1);
|
||||||
pe->fd = retired_fd;
|
pe->fd = retired_fd;
|
||||||
_retired_sync.lock ();
|
|
||||||
_retired.push_back (pe);
|
_retired.push_back (pe);
|
||||||
_retired_sync.unlock ();
|
|
||||||
|
|
||||||
// Decrease the load metric of the thread.
|
// Decrease the load metric of the thread.
|
||||||
adjust_load (-1);
|
adjust_load (-1);
|
||||||
@ -209,13 +207,11 @@ void zmq::epoll_t::loop ()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Destroy retired event sources.
|
// Destroy retired event sources.
|
||||||
_retired_sync.lock ();
|
|
||||||
for (retired_t::iterator it = _retired.begin (); it != _retired.end ();
|
for (retired_t::iterator it = _retired.begin (); it != _retired.end ();
|
||||||
++it) {
|
++it) {
|
||||||
LIBZMQ_DELETE (*it);
|
LIBZMQ_DELETE (*it);
|
||||||
}
|
}
|
||||||
_retired.clear ();
|
_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.
|
// Handle of the physical thread doing the I/O work.
|
||||||
thread_t _worker;
|
thread_t _worker;
|
||||||
|
|
||||||
// Synchronisation of retired event sources
|
|
||||||
mutex_t _retired_sync;
|
|
||||||
|
|
||||||
epoll_t (const epoll_t &);
|
epoll_t (const epoll_t &);
|
||||||
const epoll_t &operator= (const epoll_t &);
|
const epoll_t &operator= (const epoll_t &);
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user