Frank-Rainer Grahl 2 months ago
parent
commit
4bb5e9ad1a
2 changed files with 45 additions and 0 deletions
  1. 44 0
      mozilla-release/patches/1837550-11513.patch
  2. 1 0
      mozilla-release/patches/series

+ 44 - 0
mozilla-release/patches/1837550-11513.patch

@@ -0,0 +1,44 @@
+# HG changeset patch
+# User Jed Davis <jld@mozilla.com>
+# Date 1717640118 0
+# Node ID 2e7e4151f2716f71d9ce8be1171568bb38006ce3
+# Parent  98a0038cc3fc40333c026ef889af27636c1af9ab
+Bug 1837550 - Clean up control flow in WaitableEvent. r=nika, a=RyanVM
+
+Differential Revision: https://phabricator.services.mozilla.com/D212642
+
+diff --git a/ipc/chromium/src/base/waitable_event_posix.cc b/ipc/chromium/src/base/waitable_event_posix.cc
+--- a/ipc/chromium/src/base/waitable_event_posix.cc
++++ b/ipc/chromium/src/base/waitable_event_posix.cc
+@@ -86,25 +86,24 @@ class SyncWaiter : public WaitableEvent:
+   SyncWaiter(ConditionVariable* cv, Lock* lock)
+       : fired_(false),
+         cv_(cv),
+         lock_(lock),
+         signaling_event_(NULL) {
+   }
+ 
+   bool Fire(WaitableEvent *signaling_event) override {
+-    lock_->Acquire();
+-      const bool previous_value = fired_;
+-      fired_ = true;
+-      if (!previous_value)
+-        signaling_event_ = signaling_event;
+-    lock_->Release();
++    AutoLock locked(*lock_);
+ 
+-    if (previous_value)
++    if (fired_) {
+       return false;
++    }
++
++    fired_ = true;
++    signaling_event_ = signaling_event;
+ 
+     cv_->Broadcast();
+ 
+     // SyncWaiters are stack allocated on the stack of the blocking thread.
+     return true;
+   }
+ 
+   WaitableEvent* signaled_event() const {

+ 1 - 0
mozilla-release/patches/series

@@ -7196,6 +7196,7 @@ TOP-NOBUG-fixups-25320.patch
 1699950-3-88a1.patch
 1698616-90a1.patch
 1730712-1-94a1.patch
+1837550-11513.patch
 TOP-1909743-nsstyle-prefers-color-scheme-25320.patch
 TOP-NOBUG-nsstyle-prefers-contrast.patch
 TOP-NOBUG-nsstyle-prefers-reduced-motion.patch