Closed Bug 1757100 Opened 2 years ago Closed 2 years ago

Move platform-dependent parts of RWLock to mozglue

Categories

(Core :: mozglue, task)

task

Tracking

()

RESOLVED FIXED
99 Branch
Tracking Status
firefox99 --- fixed

People

(Reporter: mozbugz, Assigned: mozbugz)

References

Details

Attachments

(2 files)

I have a need for a readers-writer lock (aka shared lock) in the Base Profiler, and we already have mozilla::RWLock, but it's in xpcom.

Similar to how mozilla::Mutex in xpcom uses a light class mozilla::detail::MutexImpl in mozglue/misc/PlatformMutex.h, I would like to have a mozilla::detail::RWLockImpl in mozglue/misc/PlatformRWLock.h, which would contain the minimal platform-dependent API to implement RWLock.
(And I could use that RWLockImpl in the Base Profiler, like I already use MutexImpl.)

This is consistent with how xpcom's Mutex has its platform-dependent code in mozglue, and will allow readers-writer locks in mozglue without duplication.

Pushed by gsquelart@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/6ad74e152f2e
Move minimal platform-dependent part of RWLock to mozglue/misc/PlatformRWLock.h&cpp - r=glandium,xpcom-reviewers
https://hg.mozilla.org/integration/autoland/rev/128be99c373b
Sprinkle [[nodiscard]] and =delete in RWLock.h - r=glandium,xpcom-reviewers
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 99 Branch
Regressions: 1758115
No longer regressions: 1758115
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: