diff options
author | Adam <Adam@drink-coca-cola.info> | 2010-05-09 17:50:53 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2010-06-18 21:00:04 -0400 |
commit | 4149afd45d2c0b9f464d1b4434f7bdaa61873d44 (patch) | |
tree | 7ecbfa99c159f9bbfc89d1ec36d1f84f166dd96a /src/threadengine_pthread.cpp | |
parent | 6db15e17834163975f6122d3913d260d8327d516 (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.cpp | 3 |
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 |