detach pqistreamer threads to allow resource cleanup or re-use

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8113 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
electron128 2015-04-04 09:52:38 +00:00
parent 28030f9b08
commit 32d1bd7b04
2 changed files with 7 additions and 4 deletions

View File

@ -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)
{

View File

@ -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;