From: Eli Zaretskii Date: Sat, 27 Oct 2012 19:32:30 +0000 (+0200) Subject: Use 'volatile' types for communications between timer thread and main thread. X-Git-Tag: emacs-24.2.90~209^2~49 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2e612797ce51736ccdcd1076b3d0f36eb4c17182;p=emacs.git Use 'volatile' types for communications between timer thread and main thread. --- diff --git a/src/ChangeLog b/src/ChangeLog index 2efebc6754d..398d19fe6f2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -4,8 +4,8 @@ possible, for ITIMER_PROF count only times the main thread actually executes. * w32proc.c : 'expire' and 'reload' are now - ULONGLONG types. Likewise for all the other data which was - previously clock_t. + 'volatile ULONGLONG' types. All the other data which was + previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'. (GetThreadTimes_Proc): New typedef. (w32_get_timer_time): New function, returns a suitable time value for the timer. diff --git a/src/w32proc.c b/src/w32proc.c index 6accf2224c5..af656f915c7 100644 --- a/src/w32proc.c +++ b/src/w32proc.c @@ -245,9 +245,9 @@ setpgrp (int pid, int gid) expires, after stopping the thread which installed the timer. */ struct itimer_data { - ULONGLONG expire; - ULONGLONG reload; - int terminate; + volatile ULONGLONG expire; + volatile ULONGLONG reload; + volatile int terminate; int type; HANDLE caller_thread; HANDLE timer_thread;