Changeset 3202 for code/branches/netp5/src/network/packet/Packet.cc
- Timestamp:
- Jun 21, 2009, 12:27:19 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/netp5/src/network/packet/Packet.cc
r3097 r3202 32 32 #include <cassert> 33 33 #include <enet/enet.h> 34 #include <boost/bind.hpp> 35 #include <boost/thread/recursive_mutex.hpp> 36 37 #include "network/ConnectionManager.h" 34 38 35 #include "network/ClientInformation.h" 39 36 … … 58 55 std::map<size_t, Packet *> Packet::packetMap_; 59 56 //! Static mutex for any packetMap_ access 60 static boost::recursive_mutex packetMap_mutex_g;61 57 62 58 Packet::Packet(){ … … 142 138 // Assures we don't create a packet and destroy it right after in another thread 143 139 // without having a reference in the packetMap_ 144 boost::recursive_mutex::scoped_lock lock(packetMap_mutex_g);145 140 packetMap_[(size_t)(void*)enetPacket_] = this; 146 141 } … … 228 223 */ 229 224 void Packet::deletePacket(ENetPacket *enetPacket){ 230 boost::recursive_mutex::scoped_lock lock(packetMap_mutex_g);231 225 // Get our Packet from a gloabal map with all Packets created in the send() method of Packet. 232 226 std::map<size_t, Packet*>::iterator it = packetMap_.find((size_t)enetPacket);
Note: See TracChangeset
for help on using the changeset viewer.