From 71d3c74e90d9c3fe2d1e57e3079b331a694d3ccc Mon Sep 17 00:00:00 2001 From: Bastian Bloessl Date: Tue, 26 Aug 2014 13:47:33 +0200 Subject: [PATCH] pms: delay eof a bit --- lib/periodic_msg_source_impl.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/periodic_msg_source_impl.cc b/lib/periodic_msg_source_impl.cc index b8deabd..1ba47c9 100644 --- a/lib/periodic_msg_source_impl.cc +++ b/lib/periodic_msg_source_impl.cc @@ -65,7 +65,10 @@ periodic_msg_source_impl::run(periodic_msg_source_impl *instance) { gr::thread::scoped_lock(d_mutex); if(d_finished || !d_nmsg_left) { d_finished = true; - if(d_quit) post(pmt::mp("system"), pmt::cons(pmt::mp("done"), pmt::from_long(1))); + if(d_quit) { + boost::this_thread::sleep(boost::posix_time::milliseconds(500)); + post(pmt::mp("system"), pmt::cons(pmt::mp("done"), pmt::from_long(1))); + } break; } @@ -86,7 +89,10 @@ periodic_msg_source_impl::run(periodic_msg_source_impl *instance) { gr::thread::scoped_lock(d_mutex); dout << "PMS: thread interrupted" << std::endl; d_finished = true; - if(d_quit) post(pmt::mp("system"), pmt::cons(pmt::mp("done"), pmt::from_long(1))); + if(d_quit) { + boost::this_thread::sleep(boost::posix_time::milliseconds(500)); + post(pmt::mp("system"), pmt::cons(pmt::mp("done"), pmt::from_long(1))); + } } }