diff options
author | David Robillard <d@drobilla.net> | 2012-08-16 01:55:42 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-08-16 01:55:42 +0000 |
commit | ceffaaf18e99f2fa56f38f53cf3e4ea4f5099be6 (patch) | |
tree | 5e7da6ae491e9ab69bdfffcd2fdc4561ca5a4e4c | |
parent | 2f719c364449f3e338822e7cc740daac0870cbc9 (diff) | |
download | raul-ceffaaf18e99f2fa56f38f53cf3e4ea4f5099be6.tar.gz raul-ceffaaf18e99f2fa56f38f53cf3e4ea4f5099be6.tar.bz2 raul-ceffaaf18e99f2fa56f38f53cf3e4ea4f5099be6.zip |
Remove verbose logging stuff from Thread.
git-svn-id: http://svn.drobilla.net/lad/trunk/raul@4709 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r-- | raul/Thread.hpp | 8 | ||||
-rw-r--r-- | src/Thread.cpp | 26 |
2 files changed, 3 insertions, 31 deletions
diff --git a/raul/Thread.hpp b/raul/Thread.hpp index f6f57d3..fa5a3cb 100644 --- a/raul/Thread.hpp +++ b/raul/Thread.hpp @@ -17,8 +17,6 @@ #ifndef RAUL_THREAD_HPP #define RAUL_THREAD_HPP -#include <string> - #include "raul/Noncopyable.hpp" namespace Raul { @@ -56,16 +54,13 @@ public: */ virtual bool set_scheduling(bool realtime, unsigned priority); - /** Return the name of this thread. */ - const std::string& name() const { return _name; } - protected: /** Construct a thread. * * Note this does not actually start a thread to prevent race conditions * during construction. To actually begin execution, call start(). */ - explicit Thread(const std::string& name=""); + explicit Thread(); /** Thread function to execute. * @@ -81,7 +76,6 @@ private: static void* _static_run(void* me); ThreadImpl* _impl; - std::string _name; bool _thread_exists; protected: diff --git a/src/Thread.cpp b/src/Thread.cpp index d299138..59d3f1c 100644 --- a/src/Thread.cpp +++ b/src/Thread.cpp @@ -14,18 +14,9 @@ along with Raul. If not, see <http://www.gnu.org/licenses/>. */ -#include <cstring> -#include <string> - #include <pthread.h> -#include "raul/log.hpp" #include "raul/Thread.hpp" -#include "raul/ThreadVar.hpp" - -#define LOG(s) (s("[")(_name)("] ")) - -using std::endl; namespace Raul { @@ -33,9 +24,8 @@ struct ThreadImpl { pthread_t pthread; }; -Thread::Thread(const std::string& name) +Thread::Thread() : _impl(new ThreadImpl()) - , _name(name) , _thread_exists(false) , _exit_flag(false) { @@ -60,8 +50,6 @@ void Thread::start() { if (!_thread_exists) { - LOG(info) << "Starting thread" << endl; - pthread_attr_t attr; pthread_attr_init(&attr); pthread_attr_setstacksize(&attr, 1500000); @@ -78,7 +66,6 @@ Thread::join() _exit_flag = true; pthread_join(_impl->pthread, NULL); _thread_exists = false; - LOG(info) << "Exiting thread" << endl; } } @@ -88,16 +75,7 @@ Thread::set_scheduling(bool realtime, unsigned priority) sched_param sp; sp.sched_priority = priority; const int policy = realtime ? SCHED_FIFO : SCHED_OTHER; - const int result = pthread_setschedparam(_impl->pthread, policy, &sp); - if (!result) { - LOG(info) << (fmt("Set scheduling policy to %1% priority %2%\n") - % (realtime ? "realtime" : "normal") - % sp.sched_priority); - } else { - LOG(warn) << (fmt("Unable to set scheduling policy (%1%)\n") - % strerror(result)); - } - return !result; + return !pthread_setschedparam(_impl->pthread, policy, &sp); } } // namespace Raul |