diff options
-rw-r--r-- | gr-blocks/lib/message_strobe_impl.cc | 7 | ||||
-rw-r--r-- | gr-blocks/lib/message_strobe_impl.h | 2 | ||||
-rw-r--r-- | gr-blocks/lib/message_strobe_random_impl.cc | 7 | ||||
-rw-r--r-- | gr-blocks/lib/message_strobe_random_impl.h | 2 |
4 files changed, 8 insertions, 10 deletions
diff --git a/gr-blocks/lib/message_strobe_impl.cc b/gr-blocks/lib/message_strobe_impl.cc index 8980d43530..094bb4348c 100644 --- a/gr-blocks/lib/message_strobe_impl.cc +++ b/gr-blocks/lib/message_strobe_impl.cc @@ -51,8 +51,7 @@ bool message_strobe_impl::start() // NOTE: d_finished should be something explicitly thread safe. But since // nothing breaks on concurrent access, I'll just leave it as bool. d_finished = false; - d_thread = std::shared_ptr<gr::thread::thread>( - new gr::thread::thread(std::bind(&message_strobe_impl::run, this))); + d_thread = gr::thread::thread(std::bind(&message_strobe_impl::run, this)); return block::start(); } @@ -61,8 +60,8 @@ bool message_strobe_impl::stop() { // Shut down the thread d_finished = true; - d_thread->interrupt(); - d_thread->join(); + d_thread.interrupt(); + d_thread.join(); return block::stop(); } diff --git a/gr-blocks/lib/message_strobe_impl.h b/gr-blocks/lib/message_strobe_impl.h index 988990a247..1cb75492ea 100644 --- a/gr-blocks/lib/message_strobe_impl.h +++ b/gr-blocks/lib/message_strobe_impl.h @@ -19,7 +19,7 @@ namespace blocks { class BLOCKS_API message_strobe_impl : public message_strobe { private: - std::shared_ptr<gr::thread::thread> d_thread; + gr::thread::thread d_thread; bool d_finished; long d_period_ms; pmt::pmt_t d_msg; diff --git a/gr-blocks/lib/message_strobe_random_impl.cc b/gr-blocks/lib/message_strobe_random_impl.cc index 94515f9e0e..704070b48c 100644 --- a/gr-blocks/lib/message_strobe_random_impl.cc +++ b/gr-blocks/lib/message_strobe_random_impl.cc @@ -50,8 +50,7 @@ message_strobe_random_impl::message_strobe_random_impl( { // set up ports message_port_register_out(d_port); - d_thread = std::shared_ptr<gr::thread::thread>( - new gr::thread::thread(std::bind(&message_strobe_random_impl::run, this))); + d_thread = gr::thread::thread(std::bind(&message_strobe_random_impl::run, this)); message_port_register_in(pmt::mp("set_msg")); set_msg_handler(pmt::mp("set_msg"), [this](pmt::pmt_t msg) { this->set_msg(msg); }); @@ -94,8 +93,8 @@ long message_strobe_random_impl::next_delay() message_strobe_random_impl::~message_strobe_random_impl() { d_finished = true; - d_thread->interrupt(); - d_thread->join(); + d_thread.interrupt(); + d_thread.join(); } void message_strobe_random_impl::run() diff --git a/gr-blocks/lib/message_strobe_random_impl.h b/gr-blocks/lib/message_strobe_random_impl.h index 9e1c898b31..5346c0c8ac 100644 --- a/gr-blocks/lib/message_strobe_random_impl.h +++ b/gr-blocks/lib/message_strobe_random_impl.h @@ -28,7 +28,7 @@ private: std::poisson_distribution<> pd; //(d_mean_ms); std::normal_distribution<> nd; //(d_mean_ms, d_std_ms); std::uniform_real_distribution<> ud; //(d_mean_ms - d_std_ms, d_mean_ms + d_std_ms); - std::shared_ptr<gr::thread::thread> d_thread; + gr::thread::thread d_thread; bool d_finished; pmt::pmt_t d_msg; const pmt::pmt_t d_port; |