From: ghost Date: Mon, 11 Apr 2011 12:56:20 +0000 (+0200) Subject: Merge branch 'bug_749_ethread_bugfix' into experimental X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=commitdiff_plain;h=bebd975124d229da970d05a3ca20acda3060fb1d;hp=73bbafa8b6eb3caeba4eafc434c7e404f3ccb531 Merge branch 'bug_749_ethread_bugfix' into experimental --- diff --git a/lib/base/thread.cpp b/lib/base/thread.cpp index fa923de..1fda6a4 100644 --- a/lib/base/thread.cpp +++ b/lib/base/thread.cpp @@ -58,7 +58,12 @@ int eThread::runAsync(int prio, int policy) pthread_attr_setschedpolicy(&attr, policy); pthread_attr_setschedparam(&attr, &p); } - + + if (the_thread) { + eDebug("old thread joined %d", pthread_join(the_thread, 0)); + the_thread = 0; + } + if (pthread_create(&the_thread, &attr, wrapper, this)) { pthread_attr_destroy(&attr); @@ -69,7 +74,7 @@ int eThread::runAsync(int prio, int policy) pthread_attr_destroy(&attr); return 0; -} +} int eThread::run(int prio, int policy) {