From: Andreas Monzner Date: Mon, 3 Apr 2006 22:27:16 +0000 (+0000) Subject: re-add virtual thread_finished function in eThread X-Git-Tag: 2.6.0~3717 X-Git-Url: https://git.cweiske.de/enigma2.git/commitdiff_plain/e82ff190baa45424879466594255109d98aceee0 re-add virtual thread_finished function in eThread --- 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.