]> git.tdb.fi Git - libs/core.git/blob - source/thread.cpp
Add files
[libs/core.git] / source / thread.cpp
1 /*
2 This file is part of libmspframework
3 Copyright © 2006 Mikko Rasa, Mikkosoft Productions
4 Distributed under the LGPL
5 */
6 #include <signal.h>
7 #include "thread.h"
8
9 namespace Msp {
10
11 void *Thread::join()
12 {
13         if(!thread_)
14                 return 0;
15
16         void *result;
17         pthread_join(thread_, &result);
18         thread_=0;
19         return result;
20 }
21
22 Thread::~Thread()
23 {
24         if(thread_)
25                 kill(SIGKILL);
26 }
27
28 } // namespace Msp