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

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