mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-01-11 14:40:25 +01:00
[PR #1296] [MERGED] Fix reaper deadlock #1307
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/LGUG2Z/komorebi/pull/1296
Author: @alex-ds13
Created: 2/24/2025
Status: ✅ Merged
Merged: 2/24/2025
Merged by: @LGUG2Z
Base:
master← Head:fix/reaper-deadlock📝 Commits (1)
04fdcc1fix(reaper): fix reaper deadlock at startup📊 Changes
2 files changed (+20 additions, -17 deletions)
View changed files
📝
komorebi/src/main.rs(+13 -13)📝
komorebi/src/reaper.rs(+7 -4)📄 Description
Previously the reaper at startup would lock it's own
HWNDS_CACHEand then try to lock the WM to get itsknown_hwnds, however if there was an event in the mean time, the process_event would lock the WM first and then it would try to lock the reaper'sHWNDS_CACHEto update it but it would deadlock since that would be locked by the reaper waiting for the WM to be released.This PR now makes it so we pass the
known_hwndsto the reaper as an argument at startup and it also rearranges the order of loading the listeners. Now it first loads all the manager type listeners and only after it does it load the commands and events listeners. After some testing this seems to be the best order that doesn't cause any issues at all! There were some other issues that I've noticed before when starting komorebi while having other 3rd parties trying to subscribe to it (like komorebi-bar and YASB) which would make those subscribers lock theprocess_commandthread. This doesn't seem to be happening on my tests anymore with this new order.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.