diff options
author | David Benjamin <davidben@google.com> | 2016-04-20 00:48:11 +0300 |
---|---|---|
committer | David Benjamin <davidben@google.com> | 2016-04-20 00:54:26 +0300 |
commit | f3835839b1f3f7a922748153ca5aa17132220407 (patch) | |
tree | 9705cc1c884504c62ef359931edd60c4c02db8e1 /crypto/thread_test.c | |
parent | 9dadc3b6e1c2d5e2e8a3b1188c905d5541a75df7 (diff) |
Use nanosleep instead of usleep.
usleep is guarded by feature macro insanity. Use nanosleep which looks to be
less unfriendly.
Change-Id: I75cb2284f26cdedabb19871610761ec7440b6ad3
Reviewed-on: https://boringssl-review.googlesource.com/7710
Reviewed-by: Emily Stark (Dunn) <estark@google.com>
Reviewed-by: David Benjamin <davidben@google.com>
Diffstat (limited to 'crypto/thread_test.c')
-rw-r--r-- | crypto/thread_test.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/crypto/thread_test.c b/crypto/thread_test.c index aadd65e2..92a5373b 100644 --- a/crypto/thread_test.c +++ b/crypto/thread_test.c @@ -53,7 +53,8 @@ static int wait_for_thread(thread_t thread) { #else #include <pthread.h> -#include <unistd.h> +#include <string.h> +#include <time.h> typedef pthread_t thread_t; @@ -84,7 +85,10 @@ static void once_init(void) { #if defined(OPENSSL_WINDOWS) Sleep(1 /* milliseconds */); #else - usleep(1000 /* microseconds */); + struct timespec req; + memset(&req, 0, sizeof(req)); + req.tv_nsec = 1000000; + nanosleep(&req, NULL); #endif } |