Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 10, 2008, 10:18:33 PM (16 years ago)
Author:
scheusso
Message:

some small adjustment with packetmap mutex
dedicated server tickrate limit works now:
configuration in orxonox.ini under [GSDedicate] → tickrate_

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/objecthierarchy2/src/network/packet/Packet.cc

    r2171 r2175  
    129129      return false;
    130130    }
    131     // Assures we don't create a packet and destroy it right after in another thread
    132     // without having a reference in the packetMap_
    133     boost::recursive_mutex::scoped_lock lock(Packet::packetMap_mutex);
    134131    // We deliver ENet the data address so that it doesn't memcpy everything again.
    135132    // --> We have to delete data_ ourselves!
     
    138135    // Add the packet to a global list so we can access it again once enet calls our
    139136    // 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    }
    141143  }
    142144#ifndef NDEBUG
Note: See TracChangeset for help on using the changeset viewer.