Bug 261139 - assertIsCurrent(WorkQueue::main()) will never assert
Summary: assertIsCurrent(WorkQueue::main()) will never assert
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jean-Yves Avenard [:jya]
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-09-05 02:31 PDT by Jean-Yves Avenard [:jya]
Modified: 2023-09-05 11:17 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jean-Yves Avenard [:jya] 2023-09-05 02:31:24 PDT
WorkQueue::assertIsCurrent() is broken in both the Cocoa and the Generic implementation.

In WorkQueueGeneric.cpp, it uses a ThreadLikeAssertion constructed from m_threadID which isn't initialised when using the main's RunLoop [1]

And in WorkQueueCocoa.cpp, the ThreadLikeAssertion always uses the uid of the current thread [2], as such, the ThreadLikeAssertion::isCurrent() will always return true.


[1]https://searchfox.org/wubkat/rev/68e96f24aae90f5a0a5e0c56c932c93616766cc7/Source/WTF/wtf/generic/WorkQueueGeneric.cpp#91-94
[2]https://searchfox.org/wubkat/rev/68e96f24aae90f5a0a5e0c56c932c93616766cc7/Source/WTF/wtf/cocoa/WorkQueueCocoa.cpp#114-120
Comment 1 Radar WebKit Bug Importer 2023-09-05 02:41:06 PDT
<rdar://problem/114970446>
Comment 2 Jean-Yves Avenard [:jya] 2023-09-05 06:06:33 PDT
Pull request: https://github.com/WebKit/WebKit/pull/17432
Comment 3 EWS 2023-09-05 11:17:17 PDT
Committed 267640@main (0945d4c2ea7e): <https://commits.webkit.org/267640@main>

Reviewed commits have been landed. Closing PR #17432 and removing active labels.