aboutsummaryrefslogtreecommitdiffstats
path: root/src/coding.h
diff options
context:
space:
mode:
authorEli Zaretskii2012-10-27 13:21:26 +0200
committerEli Zaretskii2012-10-27 13:21:26 +0200
commit6c16c13ed185acf16dc8f1c6ba458f1e59328e84 (patch)
tree879877acff6356de8e86be0679b04859d4d50451 /src/coding.h
parentcaa5e5a44dd23b77dfc38f7dd8b63af241149410 (diff)
downloademacs-6c16c13ed185acf16dc8f1c6ba458f1e59328e84.tar.gz
emacs-6c16c13ed185acf16dc8f1c6ba458f1e59328e84.zip
Fix w32 implementation of itimers: overflow and ITIMER_PROF.
Avoid overflow in w32 implementation of interval timers. When possible, for ITIMER_PROF count only times the main thread actually executes. src/w32proc.c <struct itimer_data>: 'expire' and 'reload' are now ULONGLONG types. Likewise for all the other data which was previously clock_t. (GetThreadTimes_Proc): New typedef. (w32_get_timer_time): New function, returns a suitable time value for the timer. (timer_loop): Enter critical section when accessing ULONGLONG values of the itimer_data struct, as these accesses are no longer atomic. Call 'w32_get_timer_time' instead of 'clock'. (init_timers): Initialize s_pfn_Get_Thread_Times. (start_timer_thread): Don't assign itimer->caller_thread here. (getitimer): Assign itimer->caller_thread here. (setitimer): Always call getitimer to get the value of ticks_now.
Diffstat (limited to 'src/coding.h')
0 files changed, 0 insertions, 0 deletions