line 542 in common/lwan.c
static volatile sig_atomic_t main_socket = -1;
in c/c++, volatile cannot ensure memory visible and atomic
atomic variable fetch and store can ensure memory visible and memory barrier
i think, change it to
volatile sig_atomic_t main_socket = -1;
is ok
line 54 in common/lwan-status.c
static volatile bool quiet = false;
the variable quiet may be used in multithreading
same as the first question, volatile cannot ensure atomic
gcc provide _sync* function to do a atomic operation,c11 and c++11 also has a standard atomic operation
line 542 in common/lwan.c static volatile sig_atomic_t main_socket = -1;
in c/c++, volatile cannot ensure memory visible and atomic atomic variable fetch and store can ensure memory visible and memory barrier i think, change it to
is ok
line 54 in common/lwan-status.c
the variable quiet may be used in multithreading same as the first question, volatile cannot ensure atomic gcc provide _sync* function to do a atomic operation,c11 and c++11 also has a standard atomic operation