[PR #1646] optimize locking mechanism for OSD messages (deadlock-proofing) #600

Open
opened 2026-01-29 19:08:44 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/stenzek/duckstation/pull/1646

State: closed
Merged: Yes


Added benefits:

  • uses newly-added EnumerateOSDMessages for the Common UI OSD, same as is used for Fullscreen UI.

It's always a good idea to implement message queues in the fashion I've done here, to avoid the edge case where a callback GUI function might do something that itself blocks against some other mutex and then poses a risk for deadlock. Since the emulator doesn't really make use of threads much at this point, there's not a lot of immediate tangible benefit to this change. It's really more of an academic change, with potentially some future-proofing qualities.

I also removed some dead code from FullscreenUI. The enumerator handles the display_show_osd_messages setting internally now so FullscreenUI didn't need a special case handler anymore.

**Original Pull Request:** https://github.com/stenzek/duckstation/pull/1646 **State:** closed **Merged:** Yes --- Added benefits: - uses newly-added EnumerateOSDMessages for the Common UI OSD, same as is used for Fullscreen UI. It's always a good idea to implement message queues in the fashion I've done here, to avoid the edge case where a callback GUI function might do something that itself blocks against some other mutex and then poses a risk for deadlock. Since the emulator doesn't really make use of threads much at this point, there's not a lot of immediate tangible benefit to this change. It's really more of an academic change, with potentially some future-proofing qualities. I also removed some dead code from FullscreenUI. The enumerator handles the `display_show_osd_messages` setting internally now so FullscreenUI didn't need a special case handler anymore.
claunia added the pull-request label 2026-01-29 19:08:44 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/duckstation#600