diff options
author | David Robillard <d@drobilla.net> | 2017-02-27 11:36:02 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2017-02-27 20:41:47 +0100 |
commit | d348561aaf77f96aaa8c2454bce9b13b87f3cd29 (patch) | |
tree | d052ffd0355595c03dd81d8f5c485653cfeacc96 /test | |
parent | 808b1de00e29421b542fa8ef781979351dc0fcf7 (diff) | |
download | raul-d348561aaf77f96aaa8c2454bce9b13b87f3cd29.tar.gz raul-d348561aaf77f96aaa8c2454bce9b13b87f3cd29.tar.bz2 raul-d348561aaf77f96aaa8c2454bce9b13b87f3cd29.zip |
Use std::chrono::duration in Semaphore API
Diffstat (limited to 'test')
-rw-r--r-- | test/sem_test.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
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); |