Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1807)

Unified Diff: third_party/crashpad/crashpad/util/synchronization/semaphore_mac.cc

Issue 2825103002: Update Crashpad to b8aaa22905308cc400f880006a84dddac834bd6b (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;

Powered by Google App Engine
This is Rietveld 408576698