mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-22 00:06:59 +02:00
Make device state retrieval explicitly atomic.
This commit is contained in:
+4
-1
@@ -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. */
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user