diff options
author | Max Kellermann <max@duempel.org> | 2014-01-05 01:32:59 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-01-05 01:35:12 +0100 |
commit | f685a4800899cd3f7812b303a2e12700bdc445e2 (patch) | |
tree | f1177ce6002c2334c63ae4fddaaf7a668623f1ea /src/event/Loop.cxx | |
parent | 7c15e41da56243f364c32229108c5350d9b48788 (diff) | |
download | mpd-f685a4800899cd3f7812b303a2e12700bdc445e2.tar.gz mpd-f685a4800899cd3f7812b303a2e12700bdc445e2.tar.xz mpd-f685a4800899cd3f7812b303a2e12700bdc445e2.zip |
event/Loop: move code to HandleDeferred()
Diffstat (limited to '')
-rw-r--r-- | src/event/Loop.cxx | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/event/Loop.cxx b/src/event/Loop.cxx index 57c966bb7..8c8ac9993 100644 --- a/src/event/Loop.cxx +++ b/src/event/Loop.cxx @@ -217,15 +217,9 @@ EventLoop::RemoveDeferred(DeferredMonitor &d) deferred.erase(i); } -bool -EventLoop::OnSocketReady(gcc_unused unsigned flags) +void +EventLoop::HandleDeferred() { - assert(!quit); - - wake_fd.Read(); - - mutex.lock(); - while (!deferred.empty() && !quit) { DeferredMonitor &m = *deferred.front(); assert(m.pending); @@ -237,7 +231,17 @@ EventLoop::OnSocketReady(gcc_unused unsigned flags) m.RunDeferred(); mutex.lock(); } +} +bool +EventLoop::OnSocketReady(gcc_unused unsigned flags) +{ + assert(!quit); + + wake_fd.Read(); + + mutex.lock(); + HandleDeferred(); mutex.unlock(); return true; |