Skip to content

Commit

Permalink
[C] SetWaitableTimer expects a duration in 100-nanosecond intervals (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ltrzesniewski authored Feb 20, 2020
1 parent d33f4da commit 910129e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions aeron-driver/src/main/c/concurrent/aeron_thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
void aeron_nano_sleep(uint64_t nanoseconds)
{
#ifdef AERON_COMPILER_MSVC
HANDLE timer;
LARGE_INTEGER li;

if (!(timer = CreateWaitableTimer(NULL, TRUE, NULL)))
HANDLE timer = CreateWaitableTimer(NULL, TRUE, NULL);
if (!timer)
{
return;
}

li.QuadPart = -nanoseconds;
LARGE_INTEGER li;
li.QuadPart = -(int64_t)(nanoseconds / 100);

if (!SetWaitableTimer(timer, &li, 0, NULL, NULL, FALSE))
{
CloseHandle(timer);
Expand Down

0 comments on commit 910129e

Please # to comment.