Skip to content

Commit

Permalink
fixed potential race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
orignal committed Aug 25, 2018
1 parent c0d1e2c commit 062d8d0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libi2pd_client/AddressBook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,8 @@ namespace client
},
SUBSCRIPTION_REQUEST_TIMEOUT);
std::unique_lock<std::mutex> l(newDataReceivedMutex);
if (newDataReceived.wait_for (l, std::chrono::seconds (SUBSCRIPTION_REQUEST_TIMEOUT)) == std::cv_status::timeout)
// wait 1 more second
if (newDataReceived.wait_for (l, std::chrono::seconds (SUBSCRIPTION_REQUEST_TIMEOUT + 1)) == std::cv_status::timeout)
{
LogPrint (eLogError, "Addressbook: subscriptions request timeout expired");
numAttempts++;
Expand Down

0 comments on commit 062d8d0

Please sign in to comment.