From 10b7f835854f46ac390fdb6954d312a6b0ba30e9 Mon Sep 17 00:00:00 2001
From: Andrej Rode <mail@andrejro.de>
Date: Thu, 13 Apr 2017 23:38:12 -0700
Subject: runtime: add barrier to synchronize block startup

---
 gnuradio-runtime/lib/tpb_thread_body.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'gnuradio-runtime/lib/tpb_thread_body.cc')

diff --git a/gnuradio-runtime/lib/tpb_thread_body.cc b/gnuradio-runtime/lib/tpb_thread_body.cc
index 93591feee2..72fc671c40 100644
--- a/gnuradio-runtime/lib/tpb_thread_body.cc
+++ b/gnuradio-runtime/lib/tpb_thread_body.cc
@@ -32,7 +32,7 @@
 
 namespace gr {
 
-  tpb_thread_body::tpb_thread_body(block_sptr block, int max_noutput_items)
+  tpb_thread_body::tpb_thread_body(block_sptr block, gr::thread::barrier_sptr start_sync, int max_noutput_items)
     : d_exec(block, max_noutput_items)
   {
     //std::cerr << "tpb_thread_body: " << block << std::endl;
@@ -92,6 +92,7 @@ namespace gr {
     // make sure our block isnt finished
     block->clear_finished();
 
+    start_sync->wait();
     while(1) {
       tpb_loop_top:
       boost::this_thread::interruption_point();
-- 
cgit v1.2.3