X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/e51726bcb1904bf8422b62798bd9f0cd2efb53ad..c26cf2bece26e34923c082d2e2b08ccf08531d90:/lib/base/thread.cpp diff --git a/lib/base/thread.cpp b/lib/base/thread.cpp index ceb50bfe..9878856e 100644 --- a/lib/base/thread.cpp +++ b/lib/base/thread.cpp @@ -2,6 +2,7 @@ #include #include +#include #include void eThread::thread_completed(void *ptr) @@ -15,6 +16,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) @@ -93,12 +96,13 @@ int eThread::sync(void) return res; /* 0: thread is guaranteed not to run. 1: state unknown. */ } -void eThread::sendSignal(int sig) +int eThread::sendSignal(int sig) { if (m_alive) - pthread_kill(the_thread, sig); + return pthread_kill(the_thread, sig); else eDebug("send signal to non running thread"); + return -1; } void eThread::kill(bool sendcancel)