]> git.tdb.fi Git - libs/core.git/blobdiff - source/thread.cpp
Add files
[libs/core.git] / source / thread.cpp
diff --git a/source/thread.cpp b/source/thread.cpp
new file mode 100644 (file)
index 0000000..3846573
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+This file is part of libmspframework
+Copyright © 2006 Mikko Rasa, Mikkosoft Productions
+Distributed under the LGPL
+*/
+#include <signal.h>
+#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