mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-29 14:14:45 +03:00
sleep: Make variable written in signal handler volatile
No difference in practice, but it's tidier and protects us if we ever use g_interrupted earlier in main -- in that case, the compiler might chose to keep the variable in a register without the volatile. Found by @bugaevc, thanks!
This commit is contained in:
parent
a7f786fc0a
commit
a2a54f459f
Notes:
sideshowbarker
2024-07-19 02:49:03 +09:00
Author: https://github.com/nico Commit: https://github.com/SerenityOS/serenity/commit/a2a54f459f4 Pull-request: https://github.com/SerenityOS/serenity/pull/3444
@ -30,7 +30,7 @@
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
static bool g_interrupted;
|
||||
static volatile bool g_interrupted;
|
||||
static void handle_sigint(int)
|
||||
{
|
||||
g_interrupted = true;
|
||||
|
Loading…
Reference in New Issue
Block a user