summaryrefslogtreecommitdiff
path: root/src/threadengine_pthread.cpp
diff options
context:
space:
mode:
authorAdam <Adam@drink-coca-cola.info>2010-05-09 17:50:53 -0400
committerAdam <Adam@anope.org>2010-06-18 21:00:04 -0400
commit4149afd45d2c0b9f464d1b4434f7bdaa61873d44 (patch)
tree7ecbfa99c159f9bbfc89d1ec36d1f84f166dd96a /src/threadengine_pthread.cpp
parent6db15e17834163975f6122d3913d260d8327d516 (diff)
Changed threadengine to delete threads after Joining them, so the whole thread exists when being joined and so its safe to call non-threadsafe functions in the destructor
Diffstat (limited to 'src/threadengine_pthread.cpp')
-rw-r--r--src/threadengine_pthread.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/threadengine_pthread.cpp b/src/threadengine_pthread.cpp
index 58b3a11ac..199bd0860 100644
--- a/src/threadengine_pthread.cpp
+++ b/src/threadengine_pthread.cpp
@@ -6,6 +6,7 @@ void Thread::Join()
{
SetExitState();
pthread_join(Handle, NULL);
+ delete this;
}
/* Threadengine attributes used by this thread engine */
@@ -18,7 +19,7 @@ static void *entry_point(void *parameter)
{
Thread *thread = static_cast<Thread *>(parameter);
thread->Run();
- return parameter;
+ pthread_exit(0);
}
/** Threadengines constructor