Make sigint handler variable volatile
authorJason Garrett-Glaser <darkshikari@gmail.com>
Wed, 29 Sep 2010 07:15:14 +0000 (00:15 -0700)
committerJason Garrett-Glaser <darkshikari@gmail.com>
Sun, 10 Oct 2010 21:43:40 +0000 (14:43 -0700)
Didn't actually cause any problems, but is necessary because it can be modified by another thread (the signal call).

x264.c

diff --git a/x264.c b/x264.c
index 415181c..433d3dd 100644 (file)
--- a/x264.c
+++ b/x264.c
@@ -56,9 +56,9 @@
 #endif
 
 /* Ctrl-C handler */
-static int     b_ctrl_c = 0;
-static int     b_exit_on_ctrl_c = 0;
-static void    SigIntHandler( int a )
+static volatile int b_ctrl_c = 0;
+static int          b_exit_on_ctrl_c = 0;
+static void SigIntHandler( int a )
 {
     if( b_exit_on_ctrl_c )
         exit(0);