diff options
| author | Vaxry <vaxry@vaxry.net> | 2024-04-07 21:55:14 +0100 |
|---|---|---|
| committer | Vaxry <vaxry@vaxry.net> | 2024-04-07 21:55:29 +0100 |
| commit | 863c7b6072d6cd0471e6e1e5902745eedd072a06 (patch) | |
| tree | 422be4471b9ce79b9f0ba1eb457579b3d5ce31a7 /src/managers/eventLoop/EventLoopManager.hpp | |
| parent | c0d283016bd4ccbd64aeb2cc0876cf2fb663053c (diff) | |
eventloop: move timers to an event loop fd
fixes #5481
Diffstat (limited to 'src/managers/eventLoop/EventLoopManager.hpp')
| -rw-r--r-- | src/managers/eventLoop/EventLoopManager.hpp | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/src/managers/eventLoop/EventLoopManager.hpp b/src/managers/eventLoop/EventLoopManager.hpp index d55b54a9..fe864f16 100644 --- a/src/managers/eventLoop/EventLoopManager.hpp +++ b/src/managers/eventLoop/EventLoopManager.hpp @@ -10,10 +10,14 @@ class CEventLoopManager { public: + CEventLoopManager(); + void enterLoop(wl_display* display, wl_event_loop* wlEventLoop); void addTimer(std::shared_ptr<CEventLoopTimer> timer); void removeTimer(std::shared_ptr<CEventLoopTimer> timer); + void onTimerFire(); + // recalculates timers void nudgeTimers(); @@ -21,26 +25,12 @@ class CEventLoopManager { struct { wl_event_loop* loop = nullptr; wl_display* display = nullptr; - std::thread pollThread; } m_sWayland; struct { - std::mutex timersMutex; - std::mutex timersRqMutex; std::vector<std::shared_ptr<CEventLoopTimer>> timers; - std::thread timerThread; - bool event = false; - std::condition_variable cv; + int timerfd = -1; } m_sTimers; - - struct { - std::mutex loopMutex; - std::mutex eventRequestMutex; - bool event = false; - std::condition_variable cv; - } m_sLoopState; - - bool m_bTerminate = false; }; inline std::unique_ptr<CEventLoopManager> g_pEventLoopManager;
\ No newline at end of file |
