event/DeferredMonitor: make fully thread-safe
Instead of creating a new eventfd for each DeferredMonitor instance,
reuse EventLoop's eventfd, and add a std::list to EventLoop that
manages the list of pending DeferredMonitors. This std::list is
protected by the same mutex as the "calls" list.
The bottom line is: reduced overhead because the per-instance eventfd
was eliminated, slightly added overhead due to Mutex usage (but
negligible), and we're thread-safe now.
This subsystem is now good enough to replace EventLoop::AddCall().
Showing
Please
register
or
sign in
to comment