Closed
Bug 1193245
Opened 10 years ago
Closed 10 years ago
Using Atomic in the suspend count of the media resource
Categories
(Core :: Audio/Video, defect)
Core
Audio/Video
Tracking
()
RESOLVED
FIXED
mozilla43
Tracking | Status | |
---|---|---|
firefox43 | --- | fixed |
People
(Reporter: alwu, Assigned: alwu)
References
Details
Attachments
(1 file)
This bug is file from the bug1187092 comment34.
We need to use Atomic in the |mSuspendCount|.
Comment 1•10 years ago
|
||
Please restate the problem so it is easier to understand what this bug tries to fix.
Assignee | ||
Updated•10 years ago
|
Comment hidden (obsolete) |
Comment 3•10 years ago
|
||
The problem is the lock is not always held when updating mSuspendCount which results in a data race. Since we are gonna move mSuspendCount into the suspend agent, and it is the only one member needing to be synchronized, we can just conveniently convert it to an Atomic to fix the data race.
Assignee | ||
Comment 4•10 years ago
|
||
Bug 1193245 - Using Atomic in the suspend count of the media resource.
In present codebase, the |mSuspendCount| would be accessed in main thread and state machine thread, and we use the lock mechanism to avoid the race condition.
However, we can use another more easier way to achieve it, that is using Atomic for the |mSuspendCount|.
Attachment #8646734 -
Flags: review?(jwwang)
Comment 5•10 years ago
|
||
https://reviewboard.mozilla.org/r/15873/#review14111
Looks good to me.
Assignee | ||
Comment 6•10 years ago
|
||
Try-server result.
https://treeherder.mozilla.org/#/jobs?repo=try&revision=7e6ce8ff95e2
Updated•10 years ago
|
Attachment #8646734 -
Flags: review?(jwwang) → review+
Assignee | ||
Updated•10 years ago
|
Keywords: checkin-needed
Keywords: checkin-needed
Status: NEW → RESOLVED
Closed: 10 years ago
status-firefox43:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla43
Comment 10•10 years ago
|
||
Per discussion on IRC and comment 3, we still prefer atomic over mutex for there is only one member to synchronize and atomic is more efficient and easier to use than mutex.
Flags: needinfo?(jwwang)
You need to log in
before you can comment on or make changes to this bug.
Description
•