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

Unified Diff: third_party/crashpad/crashpad/util/synchronization/semaphore_win.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_win.cc
diff --git a/third_party/crashpad/crashpad/util/synchronization/semaphore_win.cc b/third_party/crashpad/crashpad/util/synchronization/semaphore_win.cc
index 962c7baeac6aa09a4aad20dbab982d7acfba7820..2f26c2379b1213c2f505e0d6611d7f71a2941bfc 100644
--- a/third_party/crashpad/crashpad/util/synchronization/semaphore_win.cc
+++ b/third_party/crashpad/crashpad/util/synchronization/semaphore_win.cc
@@ -14,6 +14,7 @@
#include "util/synchronization/semaphore.h"
+#include <cmath>
#include <limits>
#include "base/logging.h"
@@ -38,6 +39,12 @@ void Semaphore::Wait() {
bool Semaphore::TimedWait(double seconds) {
DCHECK_GE(seconds, 0.0);
+
+ if (std::isinf(seconds)) {
+ Wait();
+ return true;
+ }
+
DWORD rv = WaitForSingleObject(semaphore_, static_cast<DWORD>(seconds * 1E3));
PCHECK(rv == WAIT_OBJECT_0 || rv == WAIT_TIMEOUT) << "WaitForSingleObject";
return rv == WAIT_OBJECT_0;

Powered by Google App Engine
This is Rietveld 408576698