diff options
author | Chris Robinson <[email protected]> | 2017-02-24 01:47:34 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2017-02-24 01:47:34 -0800 |
commit | eceeabaf2ff3814c2a8dbb5b67f79e87cfaa97cd (patch) | |
tree | 93b6f9cabb308fcf742c88c82d67abe1dfb6337a /OpenAL32/Include | |
parent | 652ef2b7fd53bbc5040b9288e2c6a03ef1934879 (diff) |
Improve handling of source state reads
This avoids using seq_cst for loading the source state when either inside the
mixer, or otherwise protected from inconsistencies with async updates. It also
fixes potential race conditions with getting the source offset just as a source
stops.
Diffstat (limited to 'OpenAL32/Include')
-rw-r--r-- | OpenAL32/Include/alSource.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/OpenAL32/Include/alSource.h b/OpenAL32/Include/alSource.h index 8889ed24..6282939e 100644 --- a/OpenAL32/Include/alSource.h +++ b/OpenAL32/Include/alSource.h @@ -226,7 +226,7 @@ ALboolean ApplyOffset(ALsource *Source); inline ALboolean IsPlayingOrPaused(const ALsource *source) { - ALenum state = ATOMIC_LOAD_SEQ(&source->state); + ALenum state = ATOMIC_LOAD(&source->state, almemory_order_relaxed); return state == AL_PLAYING || state == AL_PAUSED; } |