summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2017-03-20 02:15:55 +0100
committerDavid Robillard <d@drobilla.net>2017-03-20 03:19:33 +0100
commitc9ab482f4acec0dae1a49bff245365ff7d8e536f (patch)
tree2bb8902c7590d06914840217ef2eec5e399667a3
parentbc0f5b77bc52054216790d48a7d09dc36c51b4f4 (diff)
downloadingen-c9ab482f4acec0dae1a49bff245365ff7d8e536f.tar.gz
ingen-c9ab482f4acec0dae1a49bff245365ff7d8e536f.tar.bz2
ingen-c9ab482f4acec0dae1a49bff245365ff7d8e536f.zip
Use more efficient memory barriers
-rw-r--r--src/server/PortImpl.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/server/PortImpl.cpp b/src/server/PortImpl.cpp
index b7331aff..88d25f63 100644
--- a/src/server/PortImpl.cpp
+++ b/src/server/PortImpl.cpp
@@ -188,7 +188,8 @@ PortImpl::activate(BufferFactory& bufs)
_monitor_value = 0.0f;
_peak = 0.0f;
- _connected_flag.clear(); // Trigger buffer re-connect next cycle
+ // Trigger buffer re-connect next cycle
+ _connected_flag.clear(std::memory_order_release);
}
void
@@ -540,7 +541,7 @@ PortImpl::update_values(SampleCount offset, uint32_t voice)
void
PortImpl::pre_process(RunContext& context)
{
- if (!_connected_flag.test_and_set()) {
+ if (!_connected_flag.test_and_set(std::memory_order_acquire)) {
connect_buffers();
clear_buffers();
}