X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fthread.cpp;fp=source%2Fthread.cpp;h=384657397337813102aef1f8fe74dec9405bc2c0;hp=0000000000000000000000000000000000000000;hb=1013e3c216cdf8e0ecc0f3b1e8314989b5333818;hpb=5780f0826f057f99593de46a583be7c098efaf90 diff --git a/source/thread.cpp b/source/thread.cpp new file mode 100644 index 0000000..3846573 --- /dev/null +++ b/source/thread.cpp @@ -0,0 +1,28 @@ +/* +This file is part of libmspframework +Copyright © 2006 Mikko Rasa, Mikkosoft Productions +Distributed under the LGPL +*/ +#include +#include "thread.h" + +namespace Msp { + +void *Thread::join() +{ + if(!thread_) + return 0; + + void *result; + pthread_join(thread_, &result); + thread_=0; + return result; +} + +Thread::~Thread() +{ + if(thread_) + kill(SIGKILL); +} + +} // namespace Msp