moved memory barriers as per this thread: http://music.columbia.edu/pipermail/portaudio/2011-August/012803.html . use volatile because MSVC Read/WriteBarrier() intrinsics are just compiler barriers, but MSVC will insert memory barriers if you use volatile. see: http://msdn.microsoft.com/en-us/library/ms686355(VS.85).aspx
This commit is contained in:
parent
fa8a45c845
commit
f22cec3d45
2 changed files with 19 additions and 7 deletions
|
|
@ -90,8 +90,8 @@ extern "C"
|
|||
typedef struct PaUtilRingBuffer
|
||||
{
|
||||
ring_buffer_size_t bufferSize; /**< Number of elements in FIFO. Power of 2. Set by PaUtil_InitRingBuffer. */
|
||||
ring_buffer_size_t writeIndex; /**< Index of next writable element. Set by PaUtil_AdvanceRingBufferWriteIndex. */
|
||||
ring_buffer_size_t readIndex; /**< Index of next readable element. Set by PaUtil_AdvanceRingBufferReadIndex. */
|
||||
volatile ring_buffer_size_t writeIndex; /**< Index of next writable element. Set by PaUtil_AdvanceRingBufferWriteIndex. */
|
||||
volatile ring_buffer_size_t readIndex; /**< Index of next readable element. Set by PaUtil_AdvanceRingBufferReadIndex. */
|
||||
ring_buffer_size_t bigMask; /**< Used for wrapping indices with extra bit to distinguish full/empty. */
|
||||
ring_buffer_size_t smallMask; /**< Used for fitting indices to buffer. */
|
||||
ring_buffer_size_t elementSizeBytes; /**< Number of bytes per element. */
|
||||
|
|
|
|||
Loading…
Reference in a new issue