mirror of
https://github.com/hyprwm/Hyprland
synced 2026-05-18 19:58:08 +02:00
* eventloopmgr: use unordered_map for readableWaiters use an unordered_map with the raw ptr as key, avoids any risk of dangling ptrs. * eventloopmgr: read the timerfd fd the manpage for timerfd_create and read states this. timefd_create creates a new timer object, and returns a file descriptor that can be used to read the number of expirations that have occurred. The FD becomes readable when the timer expires. read removes the “readable” state from the FD. so most likely it has somewhat worked because of the scheduleRecalc() function. * eventloopmgr: avoid unneeded std::function copy move the idle functions instead of copying. * eventloopmgr: remove event source before calling fn if fn causes a dispatch/reentry its gonna cause UB inside libwayland itself, remove the event source before calling the fn() avoids that entirerly. even if a new dispatch occurs. * eventloopmgr: check if timer fd is readable check if timerfd is readable before calling read on it, so we dont end up blocking on an accident, log an error if its not readable. * eventloopmgr: revert unordered_map change my mistake, the address wasnt changing on reallocations of the heap object. the only issue i was triggering was the reentry path in fn() |
||
|---|---|---|
| .. | ||
| EventLoopManager.cpp | ||
| EventLoopManager.hpp | ||
| EventLoopTimer.cpp | ||
| EventLoopTimer.hpp | ||