mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
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:
parent
f5a30c3d3f
commit
85515f0a62
@ -1767,9 +1767,7 @@ int pqissl::netstatus()
|
|||||||
|
|
||||||
int pqissl::isactive()
|
int pqissl::isactive()
|
||||||
{
|
{
|
||||||
RsStackMutex stack(mSslMtx); /**** LOCKED MUTEX ****/
|
return active; // no need to mutex this. It's atomic.
|
||||||
|
|
||||||
return active;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool pqissl::moretoread(uint32_t usec)
|
bool pqissl::moretoread(uint32_t usec)
|
||||||
|
@ -54,38 +54,36 @@ int pqithreadstreamer::tick()
|
|||||||
|
|
||||||
void pqithreadstreamer::start()
|
void pqithreadstreamer::start()
|
||||||
{
|
{
|
||||||
{
|
mToRun = true;
|
||||||
RsStackMutex stack(mThreadMutex);
|
|
||||||
mToRun = true;
|
|
||||||
}
|
|
||||||
RsThread::start();
|
RsThread::start();
|
||||||
}
|
}
|
||||||
|
|
||||||
void pqithreadstreamer::run()
|
void pqithreadstreamer::run()
|
||||||
{
|
{
|
||||||
std::cerr << "pqithreadstream::run()";
|
std::cerr << "pqithreadstream::run()";
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
|
|
||||||
{
|
{
|
||||||
RsStackMutex stack(mThreadMutex);
|
RsStackMutex stack(mThreadMutex);
|
||||||
mRunning = true;
|
mRunning = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
while(1)
|
while(1)
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
RsStackMutex stack(mThreadMutex);
|
RsStackMutex stack(mThreadMutex);
|
||||||
if (!mToRun)
|
if (!mToRun)
|
||||||
{
|
{
|
||||||
std::cerr << "pqithreadstream::run() stopping";
|
std::cerr << "pqithreadstream::run() stopping";
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
|
|
||||||
mRunning = false;
|
mRunning = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
data_tick();
|
data_tick();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void pqithreadstreamer::stop()
|
void pqithreadstreamer::stop()
|
||||||
|
Loading…
Reference in New Issue
Block a user