From 71cd1e0030fa05ed8782431dce25d5c1f0d445ba Mon Sep 17 00:00:00 2001 From: csoler Date: Mon, 8 Dec 2014 22:17:06 +0000 Subject: [PATCH] 2nd attempt at fixing tcponudp bug. To be tested. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7740 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- libretroshare/src/pqi/pqithreadstreamer.cc | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/libretroshare/src/pqi/pqithreadstreamer.cc b/libretroshare/src/pqi/pqithreadstreamer.cc index 18d582af8..33b67af02 100644 --- a/libretroshare/src/pqi/pqithreadstreamer.cc +++ b/libretroshare/src/pqi/pqithreadstreamer.cc @@ -46,7 +46,8 @@ bool pqithreadstreamer::RecvItem(RsItem *item) int pqithreadstreamer::tick() { - tick_bio(); + RsStackMutex stack(mThreadMutex); + tick_bio(); return 0; } @@ -82,8 +83,8 @@ void pqithreadstreamer::run() mRunning = false; return; } - } - data_tick(); + } + data_tick(); } } @@ -146,7 +147,10 @@ int pqithreadstreamer::data_tick() //std::cerr << "pqithreadstream::data_tick() tick_recv"; //std::cerr << std::endl; - tick_recv(recv_timeout); + { + RsStackMutex stack(mThreadMutex); + tick_recv(recv_timeout); + } // Push Items, Outside of Mutex. RsItem *incoming = NULL; @@ -158,7 +162,10 @@ int pqithreadstreamer::data_tick() //std::cerr << "pqithreadstream::data_tick() tick_send"; //std::cerr << std::endl; - tick_send(0); + { + RsStackMutex stack(mThreadMutex); + tick_send(0); + } if (sleep_period) {