Merge pull request #460 from neheb/patch-1

googletest: Switch to nanosleep
This commit is contained in:
Sergiu Deitsch 2019-10-31 22:41:36 +01:00 committed by GitHub
commit 6f5699a236
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -574,7 +574,12 @@ class Thread {
static inline void SleepForMilliseconds(int t) {
#ifndef OS_WINDOWS
# if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 199309L
const struct timespec req = {0, t * 1000 * 1000};
nanosleep(&req, NULL);
# else
usleep(t * 1000);
# endif
#else
Sleep(t);
#endif