Index: third_party/crashpad/crashpad/util/synchronization/semaphore_mac.cc |
diff --git a/third_party/crashpad/crashpad/util/synchronization/semaphore_mac.cc b/third_party/crashpad/crashpad/util/synchronization/semaphore_mac.cc |
index e8a79ab4c2dc2f58fc6fad1a8247cb705a9b7ec9..4f3bf00a10148d5118867b0e062d6728e1bc6050 100644 |
--- a/third_party/crashpad/crashpad/util/synchronization/semaphore_mac.cc |
+++ b/third_party/crashpad/crashpad/util/synchronization/semaphore_mac.cc |
@@ -14,6 +14,8 @@ |
#include "util/synchronization/semaphore.h" |
+#include <cmath> |
+ |
#include "base/logging.h" |
namespace crashpad { |
@@ -33,6 +35,12 @@ void Semaphore::Wait() { |
bool Semaphore::TimedWait(double seconds) { |
DCHECK_GE(seconds, 0.0); |
+ |
+ if (std::isinf(seconds)) { |
+ Wait(); |
+ return true; |
+ } |
+ |
const dispatch_time_t timeout = |
dispatch_time(DISPATCH_TIME_NOW, seconds * NSEC_PER_SEC); |
return dispatch_semaphore_wait(semaphore_, timeout) == 0; |