Fix panic when notification dispatch triggers notification dispatch. #18

Merged
trurl merged 1 commits from trurl/wmaker:refactor/riir.reentrant_notification_fix into refactor/riir 2026-03-02 12:16:04 -05:00
Owner

The global NotificationCenter is kept behind a mutex, which was locked when notifications were dispatched.

As a result, if notification dispatch triggered dispatch of other notifications, we would fail to unlock the mutex and panic.

This change copies dispatch instructions out from inside the mutex, releases the mutex, and then actually does the dispatch.

The global `NotificationCenter` is kept behind a mutex, which was locked when notifications were dispatched. As a result, if notification dispatch triggered dispatch of other notifications, we would fail to unlock the mutex and panic. This change copies dispatch instructions out from inside the mutex, releases the mutex, and then actually does the dispatch.
trurl added 1 commit 2026-03-02 11:46:59 -05:00
The global `NotificationCenter` is kept behind a mutex, which was locked when notifications were dispatched.

As a result, if notification dispatch triggered dispatch of other notifications, we would fail to unlock the mutex and panic.

This change copies dispatch instructions out from inside the mutex, releases the mutex, and then actually does the dispatch.
trurl force-pushed refactor/riir.reentrant_notification_fix from 0d4272da9a to cf9ea2de4d 2026-03-02 11:49:43 -05:00 Compare
Author
Owner

This fixes an obvious crash, so I'm going to merge soon. Needs tests before I do that.

This fixes an obvious crash, so I'm going to merge soon. Needs tests before I do that.
trurl force-pushed refactor/riir.reentrant_notification_fix from cf9ea2de4d to eaabf7e20c 2026-03-02 12:12:37 -05:00 Compare
trurl merged commit eaabf7e20c into refactor/riir 2026-03-02 12:16:04 -05:00
trurl deleted branch refactor/riir.reentrant_notification_fix 2026-03-02 12:16:05 -05:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: vitrine/wmaker#18