From ab2eb607c869b69e83f27bd15a5d9275075e8fdd Mon Sep 17 00:00:00 2001 From: Erik Frojdh Date: Fri, 19 Oct 2018 15:47:36 +0200 Subject: [PATCH] replced usleep with chrono and thread --- slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp b/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp index 82d79f1d5..98eee7127 100644 --- a/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp +++ b/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp @@ -22,6 +22,7 @@ #include "container_utils.h" #include #include +#include multiSlsDetector::multiSlsDetector(int id, bool verify, bool update) : detId(id), sharedMemory(0), thisMultiDetector(0), @@ -3726,8 +3727,8 @@ void multiSlsDetector::processData() { if (getJoinThreadFlag()) { break; } - usleep(100 * 1000); // 20ms need this else connecting error to - // receiver (too fast) + //otherwise error when connecting to the receiver too fast + std::this_thread::sleep_for(std::chrono::milliseconds(100)); } } }