From 012c699951f01badfbfdfc1bd0da547dd80fe740 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 20 Jan 2015 12:21:44 +0100 Subject: [PATCH] CComponentsTimer: move pthread members into startTimer() --- src/gui/components/cc_timer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/components/cc_timer.cpp b/src/gui/components/cc_timer.cpp index e303ade61..01cd9da11 100644 --- a/src/gui/components/cc_timer.cpp +++ b/src/gui/components/cc_timer.cpp @@ -55,9 +55,6 @@ CComponentsTimer::~CComponentsTimer() //thread handle void* CComponentsTimer::initTimerThread(void *arg) { - pthread_setcancelstate(PTHREAD_CANCEL_ENABLE,0); - pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS,0); - CComponentsTimer *timer = static_cast(arg); //start loop @@ -76,6 +73,9 @@ bool CComponentsTimer::startTimer() { void *ptr = static_cast(this); + pthread_setcancelstate(PTHREAD_CANCEL_ENABLE,0); + pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS,0); + if(!tm_thread) { int res = pthread_create (&tm_thread, NULL, initTimerThread, ptr) ; if (res != 0){