Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/boringssl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Benjamin <davidben@google.com>2016-04-20 00:48:11 +0300
committerDavid Benjamin <davidben@google.com>2016-04-20 00:54:26 +0300
commitf3835839b1f3f7a922748153ca5aa17132220407 (patch)
tree9705cc1c884504c62ef359931edd60c4c02db8e1 /crypto/thread_test.c
parent9dadc3b6e1c2d5e2e8a3b1188c905d5541a75df7 (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.c8
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
}