зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1415556 - P4. Make members atomics. r=padenot
They are accessed across multiple threads without the use of monitors. While it could be argued that some use of the monitor in functions accessing those members would set in place memory barriers, making them atomics remove all doubts as to the thread safetyness of their use. MozReview-Commit-ID: tyTqeGgDNM --HG-- extra : rebase_source : 420c38abcfeaa5fca2449034d8e1e3d82949d49d
This commit is contained in:
Родитель
2eda28dd35
Коммит
95a29ea071
|
@ -1486,7 +1486,7 @@ MediaStreamGraphImpl::OneIteration(GraphTime aStateEnd)
|
|||
// Process graph message from the main thread for this iteration.
|
||||
RunMessagesInQueue();
|
||||
|
||||
GraphTime stateEnd = std::min(aStateEnd, mEndTime);
|
||||
GraphTime stateEnd = std::min(aStateEnd, GraphTime(mEndTime));
|
||||
UpdateGraph(stateEnd);
|
||||
|
||||
mStateComputedTime = stateEnd;
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include "AudioMixer.h"
|
||||
#include "GraphDriver.h"
|
||||
#include "Latency.h"
|
||||
#include "mozilla/Atomics.h"
|
||||
#include "mozilla/Monitor.h"
|
||||
#include "mozilla/Services.h"
|
||||
#include "mozilla/TimeStamp.h"
|
||||
|
@ -733,7 +734,7 @@ public:
|
|||
* The graph should stop processing at or after this time.
|
||||
* Only set on main thread. Read on both main and MSG thread.
|
||||
*/
|
||||
GraphTime mEndTime;
|
||||
Atomic<GraphTime> mEndTime;
|
||||
|
||||
/**
|
||||
* True when we need to do a forced shutdown during application shutdown.
|
||||
|
@ -770,7 +771,7 @@ public:
|
|||
* LIFECYCLE_RUNNING. Since only the main thread can reset mLifecycleState to
|
||||
* LIFECYCLE_RUNNING, this can be relied on to not change unexpectedly.
|
||||
*/
|
||||
bool mDetectedNotRunning;
|
||||
Atomic<bool> mDetectedNotRunning;
|
||||
/**
|
||||
* True when a stable state runner has been posted to the appshell to run
|
||||
* RunInStableState at the next stable state.
|
||||
|
|
Загрузка…
Ссылка в новой задаче