diff options
Diffstat (limited to 'libcxx/src/thread.cpp')
-rw-r--r-- | libcxx/src/thread.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libcxx/src/thread.cpp b/libcxx/src/thread.cpp index bd2b7c39238..e6f57c46a7d 100644 --- a/libcxx/src/thread.cpp +++ b/libcxx/src/thread.cpp @@ -121,7 +121,9 @@ sleep_for(const chrono::nanoseconds& ns) ts.tv_sec = ts_sec_max; ts.tv_nsec = giga::num - 1; } - nanosleep(&ts, 0); + + while (nanosleep(&ts, &ts) == -1 && errno == EINTR) + ; } } |