summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--raul/Thread.hpp9
-rw-r--r--src/Thread.cpp12
2 files changed, 13 insertions, 8 deletions
diff --git a/raul/Thread.hpp b/raul/Thread.hpp
index 50d7025..4d5cef3 100644
--- a/raul/Thread.hpp
+++ b/raul/Thread.hpp
@@ -79,14 +79,7 @@ protected:
bool _exit_flag;
private:
-
- inline static void* _static_run(void* me) {
- pthread_setspecific(_thread_key, me);
- Thread* myself = (Thread*)me;
- myself->_run();
- myself->_pthread_exists = false;
- return NULL; // and I
- }
+ static void* _static_run(void* me);
/** Allocate thread-specific data key */
static void thread_key_alloc() {
diff --git a/src/Thread.cpp b/src/Thread.cpp
index 8e37dfe..00bc616 100644
--- a/src/Thread.cpp
+++ b/src/Thread.cpp
@@ -70,6 +70,18 @@ Thread::get()
return *this_thread;
}
+
+void*
+Thread::_static_run(void* thread)
+{
+ Thread* me = (Thread*)thread;
+ pthread_setspecific(me->_thread_key, thread);
+ me->_run();
+ me->_pthread_exists = false;
+ return NULL;
+}
+
+
/** Launch and start the thread. */
void
Thread::start()