re-add virtual thread_finished function in eThread
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>
Mon, 3 Apr 2006 22:27:16 +0000 (22:27 +0000)
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>
Mon, 3 Apr 2006 22:27:16 +0000 (22:27 +0000)
lib/base/thread.cpp
lib/base/thread.h

index ceb50bfe350c3dbab479f9150f066ebdfff3f024..8dded28ab9de8dc4474bd9c11ba60c452534153b 100644 (file)
@@ -15,6 +15,8 @@ void eThread::thread_completed(void *ptr)
                p->m_state.up();
                assert(p->m_state.value() == 1);
        }
                p->m_state.up();
                assert(p->m_state.value() == 1);
        }
+
+       p->thread_finished();
 }
 
 void *eThread::wrapper(void *ptr)
 }
 
 void *eThread::wrapper(void *ptr)
index dad80424b526571efc72ecace1848fdc769457a8..819c51fe530ea9186ea8dddaa76a246a20cbd091 100644 (file)
@@ -29,6 +29,11 @@ public:
        eThread();
        virtual ~eThread();
 
        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.
                /* runAsync starts the thread.
                   it assumes that the thread is not running,
                   i.e. sync() *must* return 0.