Make device state retrieval explicitly atomic.

This commit is contained in:
David Reid
2019-06-18 17:26:15 +10:00
parent 7a745d1d8f
commit 2c1a09d6b1
+4 -1
View File
@@ -5488,7 +5488,10 @@ static MA_INLINE void ma_device__set_state(ma_device* pDevice, ma_uint32 newStat
/* A helper for getting the state of the device. */ /* A helper for getting the state of the device. */
static MA_INLINE ma_uint32 ma_device__get_state(ma_device* pDevice) static MA_INLINE ma_uint32 ma_device__get_state(ma_device* pDevice)
{ {
return pDevice->state; ma_uint32 state;
ma_atomic_exchange_32(&state, pDevice->state);
return state;
} }