X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=blobdiff_plain;f=lib%2Fbase%2Fthread.cpp;h=1fda6a47a944efb23dd7e76a72cd7ba444991c0c;hp=fa923debe3ddf08aed24ec059b663a1b7486e071;hb=4a5f4afeff93bb2c577c135835853ebaf2c7868b;hpb=8659b61d462dd64b6278f2d6470832f46821cfd5 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) {