summaryrefslogtreecommitdiffstats
path: root/raul/Thread.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-05-14 04:30:00 +0000
committerDavid Robillard <d@drobilla.net>2012-05-14 04:30:00 +0000
commit79deafe642561936ebb3bbcf585f2c6f26b456d3 (patch)
tree896f4486237286d09440399c25c50ca97e940636 /raul/Thread.hpp
parent52e92126896c9d4e2ed2e0f3db7dd70809a473d6 (diff)
downloadraul-79deafe642561936ebb3bbcf585f2c6f26b456d3.tar.gz
raul-79deafe642561936ebb3bbcf585f2c6f26b456d3.tar.bz2
raul-79deafe642561936ebb3bbcf585f2c6f26b456d3.zip
Remove Thread context stuff and add a thread-specific variable class, ThreadVar, which can be used for this and many other things.
ClientBroadcaster => Broadcaster. git-svn-id: http://svn.drobilla.net/lad/trunk/raul@4405 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'raul/Thread.hpp')
-rw-r--r--raul/Thread.hpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/raul/Thread.hpp b/raul/Thread.hpp
index 9e184d8..9b61048 100644
--- a/raul/Thread.hpp
+++ b/raul/Thread.hpp
@@ -17,7 +17,6 @@
#ifndef RAUL_THREAD_HPP
#define RAUL_THREAD_HPP
-#include <set>
#include <string>
#include "raul/Noncopyable.hpp"
@@ -50,7 +49,7 @@ public:
* If the calling thread does not yet have a Thread object associated with
* it, one will be created.
*/
- static Thread& get();
+ static Thread& get(const std::string& name="");
virtual void start();
virtual void stop();
@@ -62,9 +61,6 @@ public:
const std::string& name() const { return _name; }
void set_name(const std::string& name) { _name = name; }
- bool is_context(unsigned context) const { return _contexts.find(context) != _contexts.end(); }
- void set_context(unsigned context) { _contexts.insert(context); }
-
protected:
explicit Thread(const std::string& name="");
Thread(pthread_t thread, const std::string& name="");
@@ -84,11 +80,10 @@ protected:
private:
static void* _static_run(void* me);
- ThreadImpl* _impl;
- std::set<unsigned> _contexts;
- std::string _name;
- bool _thread_exists;
- bool _own_thread;
+ ThreadImpl* _impl;
+ std::string _name;
+ bool _thread_exists;
+ bool _own_thread;
};
} // namespace Raul