diff options
| author | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2006-04-03 22:27:16 +0000 |
|---|---|---|
| committer | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2006-04-03 22:27:16 +0000 |
| commit | e82ff190baa45424879466594255109d98aceee0 (patch) | |
| tree | 235e3995ad31f022695ee4627be0d312f0441df2 /lib | |
| parent | 37f71cc2d80fdfb9543e95d525e13959b4cc1ea5 (diff) | |
| download | enigma2-e82ff190baa45424879466594255109d98aceee0.tar.gz enigma2-e82ff190baa45424879466594255109d98aceee0.zip | |
re-add virtual thread_finished function in eThread
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/base/thread.cpp | 2 | ||||
| -rw-r--r-- | lib/base/thread.h | 5 |
2 files changed, 7 insertions, 0 deletions
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. |
