mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-26 16:09:35 -05:00
Merge pull request #2351 from jolavillette/free_pendMutexFix
add missing mutex locks around free_pend() calls in 3 places in pqistreamer.cc
This commit is contained in:
commit
2cdad9ea66
@ -304,17 +304,13 @@ int pqistreamer::tick_bio()
|
||||
|
||||
int pqistreamer::tick_recv(uint32_t timeout)
|
||||
{
|
||||
// Apart from a few exceptions that are atomic (mLastIncomingTs, mIncomingSize), only this pqi thread reads/writes mIncoming queue and related counters.
|
||||
// The lock of pqistreamer mutex is thus not needed here.
|
||||
// The mutex lock is still needed before calling locked_addTrafficClue because this method is also used by the thread pushing packets in mOutPkts.
|
||||
// Locks around rates are provided internally.
|
||||
|
||||
if (mBio->moretoread(timeout))
|
||||
{
|
||||
handleincoming();
|
||||
}
|
||||
if(!(mBio->isactive()))
|
||||
{
|
||||
RsStackMutex stack(mStreamerMtx);
|
||||
free_pend();
|
||||
}
|
||||
return 1;
|
||||
@ -325,6 +321,7 @@ int pqistreamer::tick_send(uint32_t timeout)
|
||||
/* short circuit everything if bio isn't active */
|
||||
if (!(mBio->isactive()))
|
||||
{
|
||||
RsStackMutex stack(mStreamerMtx);
|
||||
free_pend();
|
||||
return 0;
|
||||
}
|
||||
@ -720,6 +717,7 @@ int pqistreamer::handleincoming()
|
||||
|
||||
if(!(mBio->isactive()))
|
||||
{
|
||||
RsStackMutex stack(mStreamerMtx);
|
||||
mReading_state = reading_state_initial ;
|
||||
free_pend();
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user