зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1319992: P4. Use Mutex in place of Monitor. r=jwwang
MozReview-Commit-ID: 79z6EtZQhYu --HG-- extra : rebase_source : c0b7bc861641178539cab15da843d0b4d6ae416e
This commit is contained in:
Родитель
20853d0607
Коммит
c1797cf144
|
@ -19,7 +19,6 @@
|
|||
#include "mozilla/ClearOnShutdown.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "mozilla/Mutex.h"
|
||||
#include "mozilla/SharedThreadPool.h"
|
||||
#include "mozilla/SyncRunnable.h"
|
||||
#include "nsContentUtils.h"
|
||||
|
@ -415,7 +414,7 @@ MediaFormatReader::DecoderFactory::DoInitDecoder(TrackType aTrack)
|
|||
[this, &data, &ownerData] (TrackType aTrack) {
|
||||
data.mInitPromise.Complete();
|
||||
data.mStage = Stage::None;
|
||||
MonitorAutoLock mon(ownerData.mMonitor);
|
||||
MutexAutoLock lock(ownerData.mMutex);
|
||||
ownerData.mDecoder = data.mDecoder.forget();
|
||||
ownerData.mDescription = ownerData.mDecoder->GetDescriptionName();
|
||||
mOwner->SetVideoDecodeThreshold();
|
||||
|
@ -2656,11 +2655,11 @@ MediaFormatReader::GetMozDebugReaderData(nsAString& aString)
|
|||
const char* videoName = audioName;
|
||||
|
||||
if (HasAudio()) {
|
||||
MonitorAutoLock mon(mAudio.mMonitor);
|
||||
MutexAutoLock lock(mAudio.mMutex);
|
||||
audioName = mAudio.mDescription;
|
||||
}
|
||||
if (HasVideo()) {
|
||||
MonitorAutoLock mon(mVideo.mMonitor);
|
||||
MutexAutoLock mon(mVideo.mMutex);
|
||||
videoName = mVideo.mDescription;
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#include "mozilla/Atomics.h"
|
||||
#include "mozilla/Maybe.h"
|
||||
#include "mozilla/TaskQueue.h"
|
||||
#include "mozilla/Monitor.h"
|
||||
#include "mozilla/Mutex.h"
|
||||
|
||||
#include "MediaEventSource.h"
|
||||
#include "MediaDataDemuxer.h"
|
||||
|
@ -209,7 +209,7 @@ private:
|
|||
uint32_t aNumOfMaxError)
|
||||
: mOwner(aOwner)
|
||||
, mType(aType)
|
||||
, mMonitor("DecoderData")
|
||||
, mMutex("DecoderData")
|
||||
, mDescription("shutdown")
|
||||
, mUpdateScheduled(false)
|
||||
, mDemuxEOS(false)
|
||||
|
@ -243,14 +243,14 @@ private:
|
|||
// Callback that receives output and error notifications from the decoder.
|
||||
nsAutoPtr<DecoderCallback> mCallback;
|
||||
|
||||
// Monitor protecting mDescription and mDecoder.
|
||||
Monitor mMonitor;
|
||||
// Mutex protecting mDescription and mDecoder.
|
||||
Mutex mMutex;
|
||||
// The platform decoder.
|
||||
RefPtr<MediaDataDecoder> mDecoder;
|
||||
const char* mDescription;
|
||||
void ShutdownDecoder()
|
||||
{
|
||||
MonitorAutoLock mon(mMonitor);
|
||||
MutexAutoLock lock(mMutex);
|
||||
if (mDecoder) {
|
||||
mDecoder->Shutdown();
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче