# HG changeset patch # User Chris Cannam # Date 1539259701 -3600 # Node ID 66c1988fc906af484f4e6d839b1a2abcf6eda128 # Parent 05c3fbaec8ea81bded744ac75c368c4dc0080ac3 Use bqvec barrier diff -r 05c3fbaec8ea -r 66c1988fc906 base/RingBuffer.h --- a/base/RingBuffer.h Wed Oct 10 14:32:34 2018 +0100 +++ b/base/RingBuffer.h Thu Oct 11 13:08:21 2018 +0100 @@ -18,13 +18,15 @@ This file copyright 2000-2006 Chris Cannam. */ -#ifndef _RINGBUFFER_H_ -#define _RINGBUFFER_H_ +#ifndef SV_RINGBUFFER_H +#define SV_RINGBUFFER_H #include #include "system/System.h" +#include + #include // memcpy, memset &c //#define DEBUG_RINGBUFFER 1 @@ -339,7 +341,7 @@ memcpy(destination + here, m_buffer, (n - here) * sizeof(T)); } - MBARRIER(); + BQ_MBARRIER(); m_readers[R] = (m_readers[R] + n) % m_size; #ifdef DEBUG_RINGBUFFER @@ -382,7 +384,7 @@ } } - MBARRIER(); + BQ_MBARRIER(); m_readers[R] = (m_readers[R] + n) % m_size; return n; } @@ -405,7 +407,7 @@ return t; } T value = m_buffer[m_readers[R]]; - MBARRIER(); + BQ_MBARRIER(); if (++m_readers[R] == m_size) m_readers[R] = 0; return value; } @@ -512,7 +514,7 @@ memcpy(m_buffer, source + here, (n - here) * sizeof(T)); } - MBARRIER(); + BQ_MBARRIER(); m_writer = (m_writer + n) % m_size; #ifdef DEBUG_RINGBUFFER @@ -548,7 +550,7 @@ memset(m_buffer, 0, (n - here) * sizeof(T)); } - MBARRIER(); + BQ_MBARRIER(); m_writer = (m_writer + n) % m_size; return n; }