From 674080a6d9c8172de5d1574684677c434fc23ad9 Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Mon, 2 Jun 2008 16:53:34 +0000 Subject: [PATCH] Fix a thread not being stopped causing strange connection problems --- thread.c | 4 +++- vompclientrrproc.c | 7 ++++++- vompclientrrproc.h | 2 ++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/thread.c b/thread.c index c89c8ef..77d5544 100755 --- a/thread.c +++ b/thread.c @@ -90,10 +90,12 @@ void Thread::threadSignalNoLock() { pthread_cond_signal(&threadCond); } - +#include "log.h" void Thread::threadWaitForSignal() { + Log::getInstance()->log("Thread", Log::DEBUG, "Entering wait"); pthread_cond_wait(&threadCond, &threadCondMutex); + Log::getInstance()->log("Thread", Log::DEBUG, "Leaving wait"); } void Thread::threadDetach() diff --git a/vompclientrrproc.c b/vompclientrrproc.c index bde6a43..66a2a2e 100644 --- a/vompclientrrproc.c +++ b/vompclientrrproc.c @@ -45,6 +45,11 @@ VompClientRRProc::VompClientRRProc(VompClient& x) resp = NULL; } +VompClientRRProc::~VompClientRRProc() +{ + threadStop(); +} + bool VompClientRRProc::init() { return threadStart(); @@ -94,7 +99,7 @@ void VompClientRRProc::threadMethod() threadWaitForSignal(); if (!req) { - log->log("RRProc", Log::ERR, "threadMethod err 2"); + log->log("RRProc", Log::INFO, "threadMethod err 2 or quit"); threadUnlock(); return; } diff --git a/vompclientrrproc.h b/vompclientrrproc.h index 64305a5..895f6af 100644 --- a/vompclientrrproc.h +++ b/vompclientrrproc.h @@ -43,6 +43,8 @@ class VompClientRRProc : public Thread { public: VompClientRRProc(VompClient& x); + ~VompClientRRProc(); + bool init(); bool recvRequest(RequestPacket*); -- 2.39.5