From 2f719c364449f3e338822e7cc740daac0870cbc9 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 16 Aug 2012 00:59:35 +0000 Subject: Remove Raul::Slave class. Merge Thread::stop() and Thread::join(). Clean thread shut down without the use of pthread_cancel(). git-svn-id: http://svn.drobilla.net/lad/trunk/raul@4708 a436a847-0d15-0410-975c-d299462d15a1 --- src/Thread.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/Thread.cpp b/src/Thread.cpp index 1f85ce0..d299138 100644 --- a/src/Thread.cpp +++ b/src/Thread.cpp @@ -43,7 +43,7 @@ Thread::Thread(const std::string& name) Thread::~Thread() { - stop(); + join(); delete _impl; } @@ -72,23 +72,16 @@ Thread::start() } void -Thread::stop() +Thread::join() { if (_thread_exists) { _exit_flag = true; - pthread_cancel(_impl->pthread); pthread_join(_impl->pthread, NULL); _thread_exists = false; LOG(info) << "Exiting thread" << endl; } } -void -Thread::join() -{ - pthread_join(_impl->pthread, NULL); -} - bool Thread::set_scheduling(bool realtime, unsigned priority) { -- cgit v1.2.1