From 0805fa7af37c95ac09ce3054f5d9b7cfb371e0ea Mon Sep 17 00:00:00 2001
From: Martin Hierholzer <martin.hierholzer@desy.de>
Date: Fri, 25 Nov 2016 14:43:36 +0100
Subject: [PATCH] make sure the constant value gets passed on to the receivers
 exactly one time

---
 include/ConstantAccessor.h | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/include/ConstantAccessor.h b/include/ConstantAccessor.h
index bf59096b..27be3e7e 100644
--- a/include/ConstantAccessor.h
+++ b/include/ConstantAccessor.h
@@ -32,7 +32,11 @@ namespace ChimeraTK {
       
       bool readNonBlocking() {
         mtca4u::NDRegisterAccessor<UserType>::buffer_2D[0] = _value;
-        return true;
+        if(firstRead) {
+          firstRead = false;
+          return true;
+        }
+        return false;
       }
       
       void write() {
@@ -53,6 +57,8 @@ namespace ChimeraTK {
     protected:
       
       std::vector<UserType> _value;
+      
+      bool firstRead{true};
 
   };
 
-- 
GitLab