fixed the wrong unit used for interval passed to SetWaitableTimer()

This commit is contained in:
hyung-hwan 2018-11-02 14:24:21 +00:00
parent 7f0428d288
commit 4e1ad5b5b0

View File

@ -370,7 +370,7 @@ static void vm_sleep (hcl_t* hcl, const hcl_ntime_t* dur)
if (xtn->waitable_timer) if (xtn->waitable_timer)
{ {
LARGE_INTEGER li; LARGE_INTEGER li;
li.QuadPart = -HCL_SECNSEC_TO_NSEC(dur->sec, dur->nsec); li.QuadPart = -(HCL_SECNSEC_TO_NSEC(dur->sec, dur->nsec) / 100); /* in 100 nanoseconds */
if(SetWaitableTimer(xtn->waitable_timer, &li, 0, HCL_NULL, HCL_NULL, FALSE) == FALSE) goto normal_sleep; if(SetWaitableTimer(xtn->waitable_timer, &li, 0, HCL_NULL, HCL_NULL, FALSE) == FALSE) goto normal_sleep;
WaitForSingleObject(xtn->waitable_timer, INFINITE); WaitForSingleObject(xtn->waitable_timer, INFINITE);
} }