Skip to content

Commit 9e64b43

Browse files
committed
was: make notification cancellation atomic
Notification callbacks set notify_data.cancel while notify_task reads it without holding notify_mutex. The plain bool access is therefore a data race even though updates of notify_active itself are serialized. Make only the cancel flag C11 atomic. Existing assignments and reads become sequentially consistent atomic operations, retaining the current control flow and cancellation behavior while removing undefined behavior. Reported-by: GPT-5.6-sol
1 parent 6a07344 commit 9e64b43

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

main/was.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ struct notify_data {
3636
char *audio_url;
3737
bool backlight;
3838
bool backlight_max;
39-
bool cancel;
39+
_Atomic bool cancel;
4040
char *text;
4141
int repeat;
4242
int strobe_period_ms;

0 commit comments

Comments
 (0)