Closed Bug 775106 Opened 12 years ago Closed 4 years ago

Migrate RwAutoLockRead/Write class wrappers for PR_RWLock*() from dom/camera/GonkCameraControl.cpp

Categories

(Core :: MFBT, defect)

defect
Not set
minor

Tracking

()

RESOLVED WONTFIX

People

(Reporter: mikeh, Unassigned)

References

Details

Implemented this for DOM camera support: class RwAutoLockRead { public: RwAutoLockRead(PRRWLock* aRwLock) : mRwLock(aRwLock) { PR_RWLock_Rlock(mRwLock); } ~RwAutoLockRead() { PR_RWLock_Unlock(mRwLock); } protected: PRRWLock *mRwLock; }; class RwAutoLockWrite { public: RwAutoLockWrite(PRRWLock* aRwLock) : mRwLock(aRwLock) { PR_RWLock_Wlock(mRwLock); } ~RwAutoLockWrite() { PR_RWLock_Unlock(mRwLock); } protected: PRRWLock *mRwLock; }; May be useful to others, should migrate to a more useful location once DOM camera supports lands.
(In reply to Mike Habicher [:mikeh] from comment #0) > May be useful to others, should migrate to a more useful location once DOM > camera supports lands. *support.
What use does that have, when you have a separate class for read and write lock? Anyways, this should be implemented on top of bug 773491
Component: mozglue → MFBT
Depends on: 773491
(In reply to Mike Hommey [:glandium] from comment #2) > What use does that have, when you have a separate class for read and write lock? They both operate on the same lock (created elsewhere), but give the lock the usual C++ scope management.
Component: MFBT → mozglue
Depends on: 740997
No longer depends on: 773491
Component: mozglue → MFBT
Depends on: 773491

As of now, there aren't any uses of PR_RWLock* in C++ code, so I guess we don't need this anymore.

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.