summaryrefslogtreecommitdiff
path: root/src/thread.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/thread.cc')
-rw-r--r--src/thread.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/thread.cc b/src/thread.cc
index 2791c53..147cf00 100644
--- a/src/thread.cc
+++ b/src/thread.cc
@@ -36,17 +36,21 @@ static void* thread_run(void *data) {
}
Thread::Thread()
-{}
+{
+}
Thread::~Thread()
-{}
+{
+}
void Thread::run()
{
- pthread_create (&tid, NULL, thread_run, this);
+ pthread_attr_init(&attr);
+
+ pthread_create(&tid, &attr, thread_run, this);
}
void Thread::wait_stop()
{
- pthread_join (tid, NULL);
+ pthread_join(tid, NULL);
}