From 4e1ad5b5b0b66addb05a53a0dbb8d8d464f3a1bd Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Fri, 2 Nov 2018 14:24:21 +0000 Subject: [PATCH] fixed the wrong unit used for interval passed to SetWaitableTimer() --- lib/cb-impl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cb-impl.h b/lib/cb-impl.h index 883ace6..68efa10 100644 --- a/lib/cb-impl.h +++ b/lib/cb-impl.h @@ -370,7 +370,7 @@ static void vm_sleep (hcl_t* hcl, const hcl_ntime_t* dur) if (xtn->waitable_timer) { 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; WaitForSingleObject(xtn->waitable_timer, INFINITE); }