make force_exit volatile.
authorJakob Flierl <jakob.flierl@gmail.com>
Mon, 27 Jan 2014 11:37:47 +0000 (12:37 +0100)
committerAndy Green <andy.green@linaro.org>
Sat, 15 Feb 2014 05:51:16 +0000 (13:51 +0800)
Instruct the compiler to always access force_exit in memory.

test-server/test-client.c
test-server/test-echo.c
test-server/test-server.c

index 949d398..4c2b07a 100644 (file)
@@ -38,7 +38,7 @@ static int deny_deflate;
 static int deny_mux;
 static struct libwebsocket *wsi_mirror;
 static int mirror_lifetime = 0;
-static int force_exit = 0;
+static volatile int force_exit = 0;
 static int longlived = 0;
 
 /*
index 2402f19..0979439 100644 (file)
@@ -41,7 +41,7 @@
 
 #include "../lib/libwebsockets.h"
 
-int force_exit = 0;
+static volatile int force_exit = 0;
 
 #define MAX_ECHO_PAYLOAD 1400
 #define LOCAL_RESOURCE_PATH INSTALL_DATADIR"/libwebsockets-test-server"
index eb275c5..4573a52 100644 (file)
@@ -58,7 +58,7 @@ int max_poll_elements;
 struct pollfd *pollfds;
 int *fd_lookup;
 int count_pollfds;
-int force_exit = 0;
+static volatile int force_exit = 0;
 
 /*
  * This demo server shows how to use libwebsockets for one or more