moved semaphore based thread logic up to RsThread. This should help terminating service threads properly and possibly remove the SIGSEGV when quitting

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8287 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2015-05-22 18:16:49 +00:00
parent c0ecc0da7a
commit f2d4a237ca
4 changed files with 166 additions and 216 deletions

View file

@ -26,19 +26,14 @@
#ifndef MRK_PQI_THREAD_STREAMER_HEADER
#define MRK_PQI_THREAD_STREAMER_HEADER
#include <semaphore.h>
#include "pqi/pqistreamer.h"
#include "util/rsthreads.h"
class pqithreadstreamer: public pqistreamer, private RsThread
class pqithreadstreamer: public pqistreamer, public RsThread
{
public:
pqithreadstreamer(PQInterface *parent, RsSerialiser *rss, const RsPeerId& peerid, BinInterface *bio_in, int bio_flagsin);
virtual void start();
virtual void shutdown();
virtual void fullstop();
virtual bool RecvItem(RsItem *item);
virtual int tick();
@ -55,8 +50,6 @@ protected:
private:
/* thread variables */
RsMutex mThreadMutex;
sem_t mShouldStopSemaphore;
sem_t mHasStoppedSemaphore;
};
#endif //MRK_PQI_THREAD_STREAMER_HEADER