From d348561aaf77f96aaa8c2454bce9b13b87f3cd29 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 27 Feb 2017 11:36:02 +0100 Subject: Use std::chrono::duration in Semaphore API --- test/sem_test.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test/sem_test.cpp') diff --git a/test/sem_test.cpp b/test/sem_test.cpp index 0400e38..453ba07 100644 --- a/test/sem_test.cpp +++ b/test/sem_test.cpp @@ -31,7 +31,7 @@ wait_for_sem(Raul::Semaphore* sem) static void timed_wait_for_sem(Raul::Semaphore* sem) { - while (!sem->timed_wait(100)) {} + while (!sem->timed_wait(std::chrono::milliseconds(100))) {} } int @@ -54,13 +54,13 @@ main() // Check that timed_wait actually waits const auto start = std::chrono::steady_clock::now(); - sem.timed_wait(100); + sem.timed_wait(std::chrono::milliseconds(100)); const auto end = std::chrono::steady_clock::now(); assert(end - start > std::chrono::milliseconds(100)); assert(end - start < std::chrono::milliseconds(200)); // Check that we can't successfully wait on a zero semaphore - assert(!sem.timed_wait(100)); + assert(!sem.timed_wait(std::chrono::milliseconds(100))); // Check that initial value works correctly sem = Raul::Semaphore(2); -- cgit v1.2.1