improved debugging output of rsthreads.cc (part 2)

This commit is contained in:
csoler 2016-05-04 22:34:03 -04:00
parent 2e02a89874
commit bb00e39972

View File

@ -61,6 +61,10 @@ void *RsThread::rsthread_init(void* p)
// it is a replacement for pthread_join() // it is a replacement for pthread_join()
pthread_detach(pthread_self()); pthread_detach(pthread_self());
#ifdef DEBUG_THREADS
THREAD_DEBUG << " thread is started. Calling runloop()..." << std::endl;
#endif
thread -> runloop(); thread -> runloop();
return NULL; return NULL;
} }
@ -81,6 +85,9 @@ bool RsThread::isRunning()
int sval =0; int sval =0;
sem_getvalue(&mHasStoppedSemaphore,&sval) ; sem_getvalue(&mHasStoppedSemaphore,&sval) ;
#ifdef DEBUG_THREADS
THREAD_DEBUG << " isRunning(): returning " << !sval << std::endl;
#endif
return !sval ; return !sval ;
} }
@ -89,6 +96,9 @@ bool RsThread::shouldStop()
int sval =0; int sval =0;
sem_getvalue(&mShouldStopSemaphore,&sval) ; sem_getvalue(&mShouldStopSemaphore,&sval) ;
#ifdef DEBUG_THREADS
THREAD_DEBUG << " shouldStop(): returning " << (sval > 0) << " (sval=" << sval << ") " << std::endl;
#endif
return sval > 0; return sval > 0;
} }