Closed Bug 902194 Opened 6 years ago Closed 6 years ago

Investigate whether or not EncodedBufferCache needs a reentrant lock.

Categories

(Core :: Audio/Video: Recording, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla26

People

(Reporter: khuey, Assigned: rlin)

Details

(Whiteboard: [qa-])

Attachments

(1 file)

EncodedBufferCache uses a ReentrantMonitor.  This allows the same thread to lock the monitor multiple times without deadlocking.  If that is unnecessary we should replace it with a regular Mutex.  I couldn't see any obvious paths for reentrancy, but it's possible I missed something.

I originally noticed this because of the unnecessary forward declaration at http://hg.mozilla.org/mozilla-central/annotate/3ea0cb5a747e/content/media/EncodedBufferCache.h#l17.  We should remove that even if the ReentrantMonitor is needed.
umm, I think it can use a mutex to replace the ReentrantMonitor.
Protect the mEncodedBuffers/mDataSize.
Please do that :-)
Assignee: nobody → rlin
Attached patch patch v1Splinter Review
Use MutexAutoLock to replace the ReentrantMonitor.
Attachment #787960 - Flags: review?(roc)
https://hg.mozilla.org/mozilla-central/rev/328f5dc01949
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
Blocks: MediaRecording
No longer blocks: 803414
Whiteboard: [qa-]
No longer blocks: MediaRecording
Component: Video/Audio → Video/Audio: Recording
You need to log in before you can comment on or make changes to this bug.