remove unneeded pqithreadstreamer and pqissl mutex locks

This commit is contained in:
jolavillette 2020-05-06 21:29:46 +02:00
parent 2c1238db2c
commit 4ead639e8c
2 changed files with 10 additions and 5 deletions
libretroshare/src/pqi

@ -372,9 +372,11 @@ int pqissl::status()
// tick......
int pqissl::tick()
{
RsStackMutex stack(mSslMtx); /**** LOCKED MUTEX ****/
// there is no reason to lock pqissl mutex now
// we will lock the mutex later if we actually need to call to ConnectAttempt
// RsStackMutex stack(mSslMtx); /**** LOCKED MUTEX ****/
//pqistreamer::tick();
// pqistreamer::tick();
// continue existing connection attempt.
if (!active)
@ -385,7 +387,8 @@ int pqissl::tick()
#ifdef PQISSL_LOG_DEBUG
rslog(RSL_DEBUG_BASIC, pqisslzone, "pqissl::tick() Continuing Connection Attempt!");
#endif
// now lock pqissl mutex, that will take up to 10 ms
RsStackMutex stack(mSslMtx); /**** LOCKED MUTEX ****/
ConnectAttempt();
return 1;
}

@ -43,8 +43,10 @@ bool pqithreadstreamer::RecvItem(RsItem *item)
int pqithreadstreamer::tick()
{
RsStackMutex stack(mThreadMutex);
tick_bio();
// pqithreadstreamer mutex lock is not needed here
// we are only checking if the connection is active, and if not active we will try to establish it
// RsStackMutex stack(mThreadMutex);
tick_bio();
return 0;
}