]> git.vomp.tv Git - vompserver.git/commitdiff
Fix a thread not being stopped causing strange connection problems
authorChris Tallon <chris@vomp.tv>
Mon, 2 Jun 2008 16:53:34 +0000 (16:53 +0000)
committerChris Tallon <chris@vomp.tv>
Mon, 2 Jun 2008 16:53:34 +0000 (16:53 +0000)
thread.c
vompclientrrproc.c
vompclientrrproc.h

index c89c8ef905063c04d34c70fda88789917d33694f..77d554470bf4adc1e0ed4e558fe5e5e9adf67450 100755 (executable)
--- 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()
index bde6a43d2420772b390314753f87726415c4754e..66a2a2e7ba33465b0a7b9b93aa726db6b9b11ab1 100644 (file)
@@ -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;
     }
index 64305a5aee7ee466cb9f889690c3949c64724b11..895f6af6557fce1ee3cce35f4d3cb84eb8e9cdda 100644 (file)
@@ -43,6 +43,8 @@ class VompClientRRProc : public Thread
 {
   public:
     VompClientRRProc(VompClient& x);
+    ~VompClientRRProc();
+    
     bool init();
     bool recvRequest(RequestPacket*);