diff options
author | Chris Robinson <[email protected]> | 2017-02-13 21:18:18 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2017-02-13 21:18:18 -0800 |
commit | 0d19a209014582f1e77ab3b927dfb1af6c307d66 (patch) | |
tree | 38d5b06d2003a23175522411bfeeffb8fc252f7a /Alc/mixer.c | |
parent | 0324712540f88d18f1fa8f18f7a72da06af00d75 (diff) |
Make the source state atomic
Since it's modified by the mixer when playback is ended, a plain struct member
isn't safe.
Diffstat (limited to 'Alc/mixer.c')
-rw-r--r-- | Alc/mixer.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Alc/mixer.c b/Alc/mixer.c index 592d51d4..179c028e 100644 --- a/Alc/mixer.c +++ b/Alc/mixer.c @@ -711,7 +711,7 @@ void MixSource(ALvoice *voice, ALsource *Source, ALCdevice *Device, ALsizei Samp voice->Moving = AL_TRUE; /* Update source info */ - Source->state = State; + ATOMIC_STORE(&Source->state, State, almemory_order_relaxed); ATOMIC_STORE(&Source->current_buffer, BufferListItem, almemory_order_relaxed); ATOMIC_STORE(&Source->position, DataPosInt, almemory_order_relaxed); ATOMIC_STORE(&Source->position_fraction, DataPosFrac, almemory_order_release); |