Title: [276890] trunk/Source/WebKit
Revision
276890
Author
[email protected]
Date
2021-05-03 00:02:11 -0700 (Mon, 03 May 2021)

Log Message

IPC::Semaphore operations ASSERT when the semaphore has been destroyed
https://bugs.webkit.org/show_bug.cgi?id=225142
<rdar://problem/76178000>

Patch by Kimmo Kinnunen <[email protected]> on 2021-05-03
Reviewed by Chris Dumez.

Add KERN_TERMINATED to the expected return values of semaphore_{signal,wait,timedwait} calls.

* Platform/IPC/darwin/IPCSemaphoreDarwin.cpp:
(IPC::Semaphore::signal):
(IPC::Semaphore::wait):
(IPC::Semaphore::waitFor):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (276889 => 276890)


--- trunk/Source/WebKit/ChangeLog	2021-05-03 03:11:56 UTC (rev 276889)
+++ trunk/Source/WebKit/ChangeLog	2021-05-03 07:02:11 UTC (rev 276890)
@@ -1,3 +1,18 @@
+2021-05-03  Kimmo Kinnunen  <[email protected]>
+
+        IPC::Semaphore operations ASSERT when the semaphore has been destroyed
+        https://bugs.webkit.org/show_bug.cgi?id=225142
+        <rdar://problem/76178000>
+
+        Reviewed by Chris Dumez.
+
+        Add KERN_TERMINATED to the expected return values of semaphore_{signal,wait,timedwait} calls.
+
+        * Platform/IPC/darwin/IPCSemaphoreDarwin.cpp:
+        (IPC::Semaphore::signal):
+        (IPC::Semaphore::wait):
+        (IPC::Semaphore::waitFor):
+
 2021-04-30  Darin Adler  <[email protected]>
 
         Use SortedArrayMap in a few more places

Modified: trunk/Source/WebKit/Platform/IPC/darwin/IPCSemaphoreDarwin.cpp (276889 => 276890)


--- trunk/Source/WebKit/Platform/IPC/darwin/IPCSemaphoreDarwin.cpp	2021-05-03 03:11:56 UTC (rev 276889)
+++ trunk/Source/WebKit/Platform/IPC/darwin/IPCSemaphoreDarwin.cpp	2021-05-03 07:02:11 UTC (rev 276890)
@@ -69,13 +69,13 @@
 void Semaphore::signal()
 {
     auto ret = semaphore_signal(m_semaphore);
-    ASSERT_UNUSED(ret, ret == KERN_SUCCESS);
+    ASSERT_UNUSED(ret, ret == KERN_SUCCESS || ret == KERN_TERMINATED);
 }
 
 void Semaphore::wait()
 {
     auto ret = semaphore_wait(m_semaphore);
-    ASSERT_UNUSED(ret, ret == KERN_SUCCESS);
+    ASSERT_UNUSED(ret, ret == KERN_SUCCESS || ret == KERN_TERMINATED);
 }
 
 bool Semaphore::waitFor(Timeout timeout)
@@ -83,7 +83,7 @@
     Seconds waitTime = timeout.secondsUntilDeadline();
     auto seconds = waitTime.secondsAs<unsigned>();
     auto ret = semaphore_timedwait(m_semaphore, { seconds, static_cast<clock_res_t>(waitTime.nanosecondsAs<uint64_t>() - seconds * NSEC_PER_SEC) });
-    ASSERT(ret == KERN_SUCCESS || ret == KERN_OPERATION_TIMED_OUT);
+    ASSERT(ret == KERN_SUCCESS || ret == KERN_OPERATION_TIMED_OUT || ret == KERN_TERMINATED);
     return ret == KERN_SUCCESS;
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to