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>
This commit is contained in:
parent
9dadc3b6e1
commit
f3835839b1
@ -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…
Reference in New Issue
Block a user