mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
lock queue's mutex less often
This commit is contained in:
parent
ab02f722af
commit
4a5406b803
2 changed files with 7 additions and 8 deletions
|
@ -479,11 +479,11 @@ namespace tunnel
|
|||
std::this_thread::sleep_for (std::chrono::seconds(1)); // wait for other parts are ready
|
||||
|
||||
uint64_t lastTs = 0, lastPoolsTs = 0, lastMemoryPoolTs = 0;
|
||||
std::queue <std::shared_ptr<I2NPMessage> > msgs;
|
||||
while (m_IsRunning)
|
||||
{
|
||||
try
|
||||
{
|
||||
std::queue <std::shared_ptr<I2NPMessage> > msgs;
|
||||
if (m_Queue.Wait (1,0)) // 1 sec
|
||||
{
|
||||
m_Queue.GetWholeQueue (msgs);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue