fixed cross-deadlock between pqissl and pqithreadstreamer by removing locks over atomic operations.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7766 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2014-12-16 21:46:07 +00:00
parent f5a30c3d3f
commit 85515f0a62
2 changed files with 21 additions and 25 deletions

View File

@ -1767,9 +1767,7 @@ int pqissl::netstatus()
int pqissl::isactive()
{
RsStackMutex stack(mSslMtx); /**** LOCKED MUTEX ****/
return active;
return active; // no need to mutex this. It's atomic.
}
bool pqissl::moretoread(uint32_t usec)

View File

@ -54,38 +54,36 @@ int pqithreadstreamer::tick()
void pqithreadstreamer::start()
{
{
RsStackMutex stack(mThreadMutex);
mToRun = true;
}
mToRun = true;
RsThread::start();
}
void pqithreadstreamer::run()
{
std::cerr << "pqithreadstream::run()";
std::cerr << std::endl;
std::cerr << "pqithreadstream::run()";
std::cerr << std::endl;
{
RsStackMutex stack(mThreadMutex);
mRunning = true;
}
{
RsStackMutex stack(mThreadMutex);
mRunning = true;
}
while(1)
{
{
RsStackMutex stack(mThreadMutex);
if (!mToRun)
{
std::cerr << "pqithreadstream::run() stopping";
std::cerr << std::endl;
while(1)
{
{
RsStackMutex stack(mThreadMutex);
if (!mToRun)
{
std::cerr << "pqithreadstream::run() stopping";
std::cerr << std::endl;
mRunning = false;
return;
}
mRunning = false;
return;
}
}
data_tick();
}
}
}
void pqithreadstreamer::stop()