attempt to fix the deadlock situations in pqithreadstreamer. Also solves the crash when quitting

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8009 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2015-03-10 21:16:41 +00:00
parent 4dede651c7
commit b6ce3ab7b2
3 changed files with 81 additions and 46 deletions

View file

@ -26,6 +26,7 @@
#ifndef MRK_PQI_THREAD_STREAMER_HEADER
#define MRK_PQI_THREAD_STREAMER_HEADER
#include <semaphore.h>
#include "pqi/pqistreamer.h"
#include "util/rsthreads.h"
@ -36,9 +37,9 @@ class pqithreadstreamer: public pqistreamer, public RsThread
virtual void run();
virtual void start();
virtual void stop();
virtual void shutdown();
virtual void fullstop();
virtual bool threadrunning();
//virtual bool threadrunning();
virtual bool RecvItem(RsItem *item);
virtual int tick();
@ -54,9 +55,8 @@ int data_tick();
private:
/* thread variables */
RsMutex mThreadMutex;
bool mRunning;
bool mToRun;
sem_t mShouldStopSemaphore;
sem_t mHasStoppedSemaphore;
};
#endif //MRK_PQI_THREAD_STREAMER_HEADER