From e82ff190baa45424879466594255109d98aceee0 Mon Sep 17 00:00:00 2001 From: Andreas Monzner Date: Mon, 3 Apr 2006 22:27:16 +0000 Subject: [PATCH] re-add virtual thread_finished function in eThread --- lib/base/thread.cpp | 2 ++ lib/base/thread.h | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/lib/base/thread.cpp b/lib/base/thread.cpp index ceb50bfe..8dded28a 100644 --- a/lib/base/thread.cpp +++ b/lib/base/thread.cpp @@ -15,6 +15,8 @@ void eThread::thread_completed(void *ptr) p->m_state.up(); assert(p->m_state.value() == 1); } + + p->thread_finished(); } void *eThread::wrapper(void *ptr) diff --git a/lib/base/thread.h b/lib/base/thread.h index dad80424..819c51fe 100644 --- a/lib/base/thread.h +++ b/lib/base/thread.h @@ -29,6 +29,11 @@ public: eThread(); virtual ~eThread(); + /* thread_finished is called from within the thread context as the last function + before the thread is going to die. + It should be used to do final cleanups (unlock locked mutexes ....) */ + virtual void thread_finished() {} + /* runAsync starts the thread. it assumes that the thread is not running, i.e. sync() *must* return 0. -- 2.30.2