1
0
mirror of https://github.com/PurpleI2P/i2pd.git synced 2025-02-02 15:14:14 +00:00

avoid race condition

This commit is contained in:
orignal 2014-06-26 15:41:12 -04:00
parent acbe0d801d
commit 9ad76aa0cf
2 changed files with 4 additions and 1 deletions

View File

@ -48,6 +48,7 @@ namespace tunnel
TunnelMessageBlock block;
block.deliveryType = eDeliveryTypeLocal;
block.data = msg;
std::unique_lock<std::mutex> l(m_SendMutex);
m_Gateway.SendTunnelDataMsg (block);
}
@ -81,4 +82,4 @@ namespace tunnel
}
}
}
}
}

View File

@ -2,6 +2,7 @@
#define TRANSIT_TUNNEL_H__
#include <inttypes.h>
#include <mutex>
#include "aes.h"
#include "I2NPProtocol.h"
#include "TunnelEndpoint.h"
@ -55,6 +56,7 @@ namespace tunnel
private:
std::mutex m_SendMutex;
TunnelGateway m_Gateway;
};