From 2e612797ce51736ccdcd1076b3d0f36eb4c17182 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 27 Oct 2012 21:32:30 +0200 Subject: [PATCH] Use 'volatile' types for communications between timer thread and main thread. --- src/ChangeLog | 4 ++-- src/w32proc.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) 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; -- 2.39.5