mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-17 17:59:58 -04:00
The review of the one-event-per-kind change (E-11) found a narrow window kept from before: change_event_list counts a slot (atomic_fetch_add on n_change_events) before it stores the handle there. audio_channels_live on the present path running between the two read the slot's 0 and passed it to kern_event_signal, which ends the process with "not a writable event handle". It needs a kind's first request to meet a channel-setting change. change_event_list now stores the handle with release order, and audio_channels_live loads each slot with acquire order and skips a slot that still reads 0; that slot's event is signalled by the next channel change. Not reproduced before the change in a game run. tests/audio_mixer_check.c counts a slot without storing it and changes the channels: no signal may reach handle 0, and the listed events are signalled again. Against the previous audio_mixer.c it fails with handle 0 signalled once. The check passes, and the compile check of audio_mixer.c (also with -Wall -Wextra) adds no warnings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
91 KiB
91 KiB