feat(libwebrtc): implement rtc::RecursiveCriticalSection and rtc::CritScope #14232
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/14232"
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 jacknieland on 2026-11-01T01:49:12Z.
What
Implements
rtc::RecursiveCriticalSection(constructor, destructor,Enter,Leave) andrtc::CritScope(constructor, destructor) in libwebrtc. All six threw.rtc_base/deprecated/recursive_critical_section.hand.ccare the same at M127 branch-heads/6533 and M134 branch-heads/6998, the revisions the debt file pins.src/RecursiveCriticalSection.cppfollows their POSIX path, with WebRTC's copyright notice and BSD licence at the top, asExpFilter.cppdoes:PTHREAD_MUTEX_RECURSIVE(2) guest mutex through libkernel'spthread_mutexattr_*andpthread_mutex_init, and the destructor destroys it.EnterandLeavelock and unlock it.CritScopestores the section it is given, enters it, and leaves it in its destructor.include/RecursiveCriticalSection.hppgives the 24-byte layout of the header:pthread_mutex_t mutex_(a pointer on the console) at 0,thread_at 8 andrecursion_count_at 16.thread_andrecursion_count_are only written byRTC_DCHECK_IS_ONbuilds, which also check the owning thread. Whether the module is one is unknown, so neither is written or checked, and the debt entry says so.std::invalid_argument, asExpFilterdoes.Tested
Windows 11 Pro (26200), WinLibs GCC 15.2.0 (
x86_64-ucrt-posix-seh, r7), Release,BUILD_TESTING=ON, Ninja, on head418462fbac(this branch, onmain029463ceb6).guest_webrtc_recursive_critical_sectiontest:Enters a trylock from another thread getsEBUSY, still after oneLeave, and succeeds after the second.CritScopestores its section and holds it; a nested scope's destructor leaves the outer one held, and the outer destructor frees it.CritScope, and no increment is lost.thisor section throwsstd::invalid_argument.ctest -R guest_webrtc --repeat until-fail:3: all six libwebrtc tests pass 3/3.ctest -R public_headers: 65/65 pass.NotImplemented_nid_no_patch(__func__)at the top of each of the six functions, as themainstubs do, the test fails 3/3 with_ZN3rtc24RecursiveCriticalSectionC1Ev_nid_postfix not implemented.check_conventions.py --base upstream/mainpasses. An overlap scan of the diffs of all open pull requests that touch libwebrtc found none that changes these exports; they conflict with this one only in appendedCMakeLists.txtand debt lines.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)mainafter each🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T02:25:15Z.
Review: APPROVED
Reviewed — looks good
I reviewed head
418462fbac5002d043e60645fa67710f0306d90c; the implementation follows the pinned WebRTC recursive-mutex path, and I found no blocking defect.What I ran
The PR records base
029463ceb62c97e3a82cfea423f884f158a4f023; the currentmaintip is0e9dc7bc4c9755c3ce803f6bbdff9dc9f25d68bb, and the no-build current-main preview was clean. Environment: Debian 12 x86-64, Python 3.11.2, GCC 12.2.0.Results
0e9dc7bc4c9755c3ce803f6bbdff9dc9f25d68bb.libwebrtcUnknown*NID aliases; none refers to the six changed exports.guest_webrtc_recursive_critical_sectionregistration are present inCMakeLists.txt; the quality heuristic's unregistered-test signal is a false positive.guest_webrtctests passing 3/3, and 65/65 public-header tests. I did not build or run CTest locally.Selected unedited output
Negative control
NotImplemented_nid_no_patchat each function; the test failed 3/3 with the expected not-implemented error.Sources
8d78f5de6c27b2c793039989ea381f1428fb0100Not verified
No local build, CTest, or console/title run. The independent hosted Windows job was still pending at the final check; Linux and specialized product jobs were skipped.
Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-11-01T20:00:42Z.
Review: COMMENTED
Withdrawn. The title-ID demand was not a CONTRIBUTING requirement;
Unblocks: noneis allowed and no title is known for these exports.