event/Loop: remove unused method AddCall()
This commit is contained in:
parent
1f1195975f
commit
0f9ef2506f
@ -193,16 +193,6 @@ EventLoop::Run()
|
||||
|
||||
#ifdef USE_INTERNAL_EVENTLOOP
|
||||
|
||||
void
|
||||
EventLoop::AddCall(std::function<void()> &&f)
|
||||
{
|
||||
mutex.lock();
|
||||
calls.push_back(f);
|
||||
mutex.unlock();
|
||||
|
||||
wake_fd.Write();
|
||||
}
|
||||
|
||||
void
|
||||
EventLoop::AddDeferred(DeferredMonitor &d)
|
||||
{
|
||||
@ -262,15 +252,6 @@ EventLoop::OnSocketReady(gcc_unused unsigned flags)
|
||||
mutex.lock();
|
||||
}
|
||||
|
||||
while (!calls.empty() && !quit) {
|
||||
auto f = std::move(calls.front());
|
||||
calls.pop_front();
|
||||
|
||||
mutex.unlock();
|
||||
f();
|
||||
mutex.lock();
|
||||
}
|
||||
|
||||
mutex.unlock();
|
||||
|
||||
return true;
|
||||
|
@ -30,7 +30,6 @@
|
||||
#include "WakeFD.hxx"
|
||||
#include "SocketMonitor.hxx"
|
||||
|
||||
#include <functional>
|
||||
#include <list>
|
||||
#include <set>
|
||||
#endif
|
||||
@ -91,7 +90,6 @@ class EventLoop final
|
||||
std::list<IdleMonitor *> idle;
|
||||
|
||||
Mutex mutex;
|
||||
std::list<std::function<void()>> calls;
|
||||
std::list<DeferredMonitor *> deferred;
|
||||
|
||||
unsigned now_ms;
|
||||
@ -156,13 +154,6 @@ public:
|
||||
void AddTimer(TimeoutMonitor &t, unsigned ms);
|
||||
void CancelTimer(TimeoutMonitor &t);
|
||||
|
||||
/**
|
||||
* Schedule a function to be called inside the thread.
|
||||
*
|
||||
* This method is thread-safe.
|
||||
*/
|
||||
void AddCall(std::function<void()> &&f);
|
||||
|
||||
/**
|
||||
* Schedule a call to DeferredMonitor::RunDeferred().
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user