feat(libSceNKWebKit): implement WTF::BinarySemaphore #14922
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/14922"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by w4rc0n on 2026-11-02T01:32:01Z.
What
WTF::BinarySemaphore::signal()andwaitUntil(const TimeWithDynamicClockType&)wereNotImplementedstubs. WebKit usesBinarySemaphoreto hand work from one thread to another, so those paths threw. Both now behave as the pinned PS5 WebKit 11.xBinarySemaphore.cppdoes. They are written independently on #14921'sParkingLot, not as a port of itsLockandConditionsequence:m_isSetat 0, theLockbyte at 1 andCondition's byte at 2, pinned withstatic_assert. The lock and condition bytes stay zero and unused:BinarySemaphore.hhas only the constructor and inlinewaitforwarding to the exportedwaitUntil, so no guest inline code touches them.signal: sets the flag while waking one waiter under the queue lock. Repeated signals collapse into one.waitUntil: consumes the flag during the park validation, and parks directly on the flag while it is unset. A timeout makes one last attempt to consume it. Success consumes the signal.It calls the parent's
ParkingLotfunctions directly, with no new exports or cross-library helpers. The debt entry records that layouts and scheduling aren't verified against a console.Adapted source: none in this PR.
BinarySemaphoreis written independently on #14921'sParkingLot, whose adapted lock code is insrc/WtfLock.cppunder its notice.tools/pr_overlap.pyon this head, withmainat0eba5db30d: no other open PR changes these exports or adds the same files. For the PRs it couldn't compare because they no longer merge withmain, GitHub's file lists show none of them changing these exports either. #13947, #13992, #14172, #14981, #15011, #15215 and #15866 change nearby lines in the same files; whichever merges later keeps both sides. The only exports it shares are with #14921, in the same stack.Tested
Debian 12, GCC 12.2, Linux 6.18, Release, at the head
0e54a3edd9f430785c0201831364bcd8f7f56c76, which is on #14921's head43e5f65b65b95b14fcc2a5f6a75fe26880525385. No local changes.guest_nkwebkit_dates,guest_nkwebkit_numbers,nkwebkit_base,nkwebkit_config,nkwebkit_constants,nkwebkit_fastbitvector,nkwebkit_jsc,nkwebkit_palsessionid,nkwebkit_preferences,nkwebkit_resourceresponse,nkwebkit_webcoregeometry,nkwebkit_wtf,guest_nkwebkit_urlsandpublic_headerspass. At the pre-rebase commit with the same patch, the semaphore suite also passed 50 consecutive repetitions (3.2 s in total).nkwebkit_wtfcases check public behaviour only:signalfrom another thread, with a handshake rather than sleeps;tools/progress.py: both exports count as implemented (libSceNKWebKit 1322, against 1320 with #14921).tools/check_conventions.pypasses.f54a49c07fd92fbc915bd64bd9a8241ad532f2ca. It is AnyPS5'sBuildworkflow, dispatched in the author's fork withselect=true: the branch merged intomainatb11c7bf84f5d2f636ff60166cc3371bd071e24d5, built onwindows-latestwith WinLibs GCC 15.2 (MinGW-w64, UCRT). All 809 selected tests passed, none skipped, including the twelve NKWebKit tests,public_headersandpatched_libraries. A fork-internal pull request existed only to give the workflow a number. The rebase ontomainat0eba5db30d8a3d03789e52e5c1a9ff853e4e33e4after #15911 changed onlydocs/dev/debt/libSceNKWebKit.md, sogit range-diffshows the code and tests under test are the same as at that run.Not built or run: macOS. No title or homebrew was run.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Pull request closed