Browse Source

avoid race condition

pull/73/merge
orignal 11 years ago
parent
commit
9ad76aa0cf
  1. 3
      TransitTunnel.cpp
  2. 2
      TransitTunnel.h

3
TransitTunnel.cpp

@ -48,6 +48,7 @@ namespace tunnel @@ -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 @@ -81,4 +82,4 @@ namespace tunnel
}
}
}
}
}

2
TransitTunnel.h

@ -2,6 +2,7 @@ @@ -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 @@ -55,6 +56,7 @@ namespace tunnel
private:
std::mutex m_SendMutex;
TunnelGateway m_Gateway;
};

Loading…
Cancel
Save