Browse Source

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>
kris/onging/CECPQ3_patch15
David Benjamin 8 years ago
parent
commit
f3835839b1
1 changed files with 6 additions and 2 deletions
  1. +6
    -2
      crypto/thread_test.c

+ 6
- 2
crypto/thread_test.c View File

@@ -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
}



Loading…
Cancel
Save