diff --git a/libretroshare/src/pqi/pqithreadstreamer.cc b/libretroshare/src/pqi/pqithreadstreamer.cc index 418803fbf..f6b0630f2 100644 --- a/libretroshare/src/pqi/pqithreadstreamer.cc +++ b/libretroshare/src/pqi/pqithreadstreamer.cc @@ -73,6 +73,9 @@ void pqithreadstreamer::run() std::cerr << "pqithreadstream::run()"; std::cerr << std::endl; + // tell the OS to free the thread resources when this function exits + // it is a replacement for pthread_join() + pthread_detach(pthread_self()); while(1) { diff --git a/libretroshare/src/pqi/pqithreadstreamer.h b/libretroshare/src/pqi/pqithreadstreamer.h index 79866d04c..e17b7fc85 100644 --- a/libretroshare/src/pqi/pqithreadstreamer.h +++ b/libretroshare/src/pqi/pqithreadstreamer.h @@ -30,23 +30,23 @@ #include "pqi/pqistreamer.h" #include "util/rsthreads.h" -class pqithreadstreamer: public pqistreamer, public RsThread +class pqithreadstreamer: public pqistreamer, private RsThread { public: pqithreadstreamer(PQInterface *parent, RsSerialiser *rss, const RsPeerId& peerid, BinInterface *bio_in, int bio_flagsin); -virtual void run(); virtual void start(); virtual void shutdown(); virtual void fullstop(); -//virtual bool threadrunning(); virtual bool RecvItem(RsItem *item); virtual int tick(); protected: + // from RsThread + virtual void run(); -int data_tick(); + int data_tick(); PQInterface *mParent; uint32_t mTimeout;