mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-12 18:45:44 -07:00
core: fix data race and a unsigned int rollover (#7278)
* keybindmgr: avoid uint rollover on mouse keycode mouse keycode is 0, and the switch case checks for 0 - 8 and rolls over, just return early if keycode is 0. * watchdog: avoid data races in watchdog asan thread sanitizer reported data races in the watchdog from reading and setting the bool variables make them std::atomic bools. also add a atomic bool for the main thread to wait for to avoid data race when reading the config values. * hyprdebug: change non unicode character to name asan created false positives and didnt like this bit, so for the sake of easier debugging rename it to something unicode.
This commit is contained in:
@@ -552,6 +552,10 @@ void CCompositor::initManagers(eManagersInitStage stage) {
|
||||
|
||||
g_pConfigManager->init();
|
||||
g_pWatchdog = std::make_unique<CWatchdog>(); // requires config
|
||||
// wait for watchdog to initialize to not hit data races in reading config values.
|
||||
while (!g_pWatchdog->m_bWatchdogInitialized) {
|
||||
std::this_thread::yield();
|
||||
}
|
||||
|
||||
Debug::log(LOG, "Creating the PointerManager!");
|
||||
g_pPointerManager = std::make_unique<CPointerManager>();
|
||||
|
Reference in New Issue
Block a user