summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/thread.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/thread.cc')
-rw-r--r--winsup/cygwin/thread.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/winsup/cygwin/thread.cc b/winsup/cygwin/thread.cc
index 513b860d1..af0d6afc7 100644
--- a/winsup/cygwin/thread.cc
+++ b/winsup/cygwin/thread.cc
@@ -982,15 +982,14 @@ cancelable_wait (HANDLE object, PLARGE_INTEGER timeout,
if (timeout)
{
- const size_t sizeof_tbi = sizeof (TIMER_BASIC_INFORMATION);
- PTIMER_BASIC_INFORMATION tbi = (PTIMER_BASIC_INFORMATION) malloc (sizeof_tbi);
+ TIMER_BASIC_INFORMATION tbi;
- NtQueryTimer (_my_tls.locals.cw_timer, TimerBasicInformation, tbi,
- sizeof_tbi, NULL);
+ NtQueryTimer (_my_tls.locals.cw_timer, TimerBasicInformation, &tbi,
+ sizeof tbi, NULL);
/* if timer expired, TimeRemaining is negative and represents the
system uptime when signalled */
if (timeout->QuadPart < 0LL)
- timeout->QuadPart = tbi->SignalState ? 0LL : tbi->TimeRemaining.QuadPart;
+ timeout->QuadPart = tbi.SignalState ? 0LL : tbi.TimeRemaining.QuadPart;
NtCancelTimer (_my_tls.locals.cw_timer, NULL);
}