Blame SOURCES/open-iscsi-2.0.874-5-Make-event_loop_stop-volatile-for-safer-access.patch

c487f3
From 3951c242d266689a8c856717b02b07c1fe193a31 Mon Sep 17 00:00:00 2001
c487f3
From: Lee Duncan <lduncan@suse.com>
c487f3
Date: Fri, 2 Dec 2016 09:22:02 -0800
c487f3
Subject: Make event_loop_stop volatile for safer access
c487f3
c487f3
As suggested by Christian Seiler:
c487f3
"Only minor thing is that you might want to mark
c487f3
static int event_loop_stop; (usr/event_poll.c)
c487f3
to be volatile, to be on the safe side when modifying it
c487f3
from within a signal handler. Probably not really required
c487f3
here (the compiler is not allowed to optimize out the
c487f3
access anyway, since you call non-static functions within
c487f3
the loop), but it doesn't hurt either, just in case... "
c487f3
---
c487f3
 usr/event_poll.c | 2 +-
c487f3
 1 file changed, 1 insertion(+), 1 deletion(-)
c487f3
c487f3
diff --git a/usr/event_poll.c b/usr/event_poll.c
c487f3
index 209ee0280c0a..ac2504404366 100644
c487f3
--- a/usr/event_poll.c
c487f3
+++ b/usr/event_poll.c
c487f3
@@ -123,7 +123,7 @@ static int shutdown_wait_pids(void)
c487f3
 #define POLL_ALARM	2
c487f3
 #define POLL_MAX	3
c487f3
 
c487f3
-static int event_loop_stop;
c487f3
+static volatile int event_loop_stop;
c487f3
 static queue_task_t *shutdown_qtask; 
c487f3
 
c487f3
 void event_loop_exit(queue_task_t *qtask)
c487f3
-- 
c487f3
2.9.3
c487f3