[webkit-changes] [WebKit/WebKit] 0945d4: assertIsCurrent(WorkQueue::main()) will never assert

Jean-Yves Avenard noreply at github.com
Tue Sep 5 11:17:27 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 0945d4c2ea7ee0c0007cf09e85a3055ea5309e4a
      https://github.com/WebKit/WebKit/commit/0945d4c2ea7ee0c0007cf09e85a3055ea5309e4a
  Author: Jean-Yves Avenard <jya at apple.com>
  Date:   2023-09-05 (Tue, 05 Sep 2023)

  Changed paths:
    M Source/WTF/wtf/ThreadAssertions.h
    M Source/WTF/wtf/WorkQueue.cpp
    M Source/WTF/wtf/cocoa/WorkQueueCocoa.cpp
    M Source/WTF/wtf/generic/WorkQueueGeneric.cpp
    M Tools/TestWebKitAPI/Tests/WTF/WorkQueue.cpp

  Log Message:
  -----------
  assertIsCurrent(WorkQueue::main()) will never assert
https://bugs.webkit.org/show_bug.cgi?id=261139
rdar://114970446

Reviewed by Kimmo Kinnunen.

Initialise the WorkQueue threadID to 1 when creating WorkQueue::main. We can
make this assumption as the first thread ever created is the Main Thread.
Simplify WorkQueue::threadLikeAssertion() now that WorkQueue::m_threadID
is always set to either the RunLoop's uid or the dispatch_queue sequence id.

Add API test.

* Source/WTF/wtf/ThreadAssertions.h:
* Source/WTF/wtf/WorkQueue.cpp:
(WTF::WorkQueue::threadLikeAssertion const):
* Source/WTF/wtf/cocoa/WorkQueueCocoa.cpp:
(WTF::WorkQueueBase::WorkQueueBase):
(WTF::WorkQueueBase::platformInitialize):
(WTF::WorkQueue::threadLikeAssertion const): Deleted.
* Source/WTF/wtf/generic/WorkQueueGeneric.cpp:
(WTF::WorkQueueBase::WorkQueueBase):
(WTF::WorkQueue::threadLikeAssertion const): Deleted.
* Tools/TestWebKitAPI/Tests/WTF/WorkQueue.cpp:
(TestWebKitAPI::TEST):

Canonical link: https://commits.webkit.org/267640@main




More information about the webkit-changes mailing list