Changeset 2175 for code/branches/objecthierarchy2/src/network/packet
- Timestamp:
- Nov 10, 2008, 10:18:33 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchy2/src/network/packet/Packet.cc
r2171 r2175 129 129 return false; 130 130 } 131 // Assures we don't create a packet and destroy it right after in another thread132 // without having a reference in the packetMap_133 boost::recursive_mutex::scoped_lock lock(Packet::packetMap_mutex);134 131 // We deliver ENet the data address so that it doesn't memcpy everything again. 135 132 // --> We have to delete data_ ourselves! … … 138 135 // Add the packet to a global list so we can access it again once enet calls our 139 136 // deletePacket method. We can of course only give a one argument function to the ENet C library. 140 packetMap_[(size_t)(void*)enetPacket_] = this; 137 { 138 // Assures we don't create a packet and destroy it right after in another thread 139 // without having a reference in the packetMap_ 140 boost::recursive_mutex::scoped_lock lock(Packet::packetMap_mutex); 141 packetMap_[(size_t)(void*)enetPacket_] = this; 142 } 141 143 } 142 144 #ifndef NDEBUG
Note: See TracChangeset
for help on using the changeset viewer.