1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-09-18 09:00:52 +02:00

A mutex guarding access to this variable made volatile unnecessary

This commit is contained in:
Paul Licameli 2016-08-20 19:29:49 -04:00
parent 2a7d8dca77
commit 854651306c
2 changed files with 2 additions and 3 deletions

View File

@ -31,6 +31,7 @@ DEFINE_EVENT_TYPE(EVT_ODTASK_COMPLETE)
/// Constructs an ODTask /// Constructs an ODTask
ODTask::ODTask() ODTask::ODTask()
: mDemandSample(0)
{ {
static int sTaskNumber=0; static int sTaskNumber=0;
@ -41,8 +42,6 @@ ODTask::ODTask()
mIsRunning = false; mIsRunning = false;
mTaskNumber=sTaskNumber++; mTaskNumber=sTaskNumber++;
mDemandSample=0;
} }
//outside code must ensure this task is not scheduled again. //outside code must ensure this task is not scheduled again.

View File

@ -159,7 +159,7 @@ class ODTask /* not final */
std::vector<WaveTrack*> mWaveTracks; std::vector<WaveTrack*> mWaveTracks;
ODLock mWaveTrackMutex; ODLock mWaveTrackMutex;
volatile sampleCount mDemandSample; sampleCount mDemandSample;
mutable ODLock mDemandSampleMutex; mutable ODLock mDemandSampleMutex;
volatile bool mIsRunning; volatile bool mIsRunning;