Skip to content

Commit

Permalink
Make event_loop_stop volatile for safer access
Browse files Browse the repository at this point in the history
As suggested by Christian Seiler:
"Only minor thing is that you might want to mark
static int event_loop_stop; (usr/event_poll.c)
to be volatile, to be on the safe side when modifying it
from within a signal handler. Probably not really required
here (the compiler is not allowed to optimize out the
access anyway, since you call non-static functions within
the loop), but it doesn't hurt either, just in case... "
  • Loading branch information
gonzoleeman committed Dec 2, 2016
1 parent c3122e9 commit 3951c24
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion usr/event_poll.c
Expand Up @@ -123,7 +123,7 @@ static int shutdown_wait_pids(void)
#define POLL_ALARM 2
#define POLL_MAX 3

static int event_loop_stop;
static volatile int event_loop_stop;
static queue_task_t *shutdown_qtask;

void event_loop_exit(queue_task_t *qtask)
Expand Down

0 comments on commit 3951c24

Please sign in to comment.