changed writelock to readlock

plus a coding standard fix
This commit is contained in:
wangyix 2014-06-09 13:42:45 -07:00
parent ff2a5342ee
commit e45f2fed4b
2 changed files with 4 additions and 2 deletions

View file

@ -37,6 +37,8 @@ const QByteArray* SentPacketHistory::getPacket(OCTREE_PACKET_SEQUENCE sequenceNu
return NULL;
}
int packetAt = _newestPacketAt - seqDiff;
if (packetAt < 0) { packetAt += _sentPackets.size(); }
if (packetAt < 0) {
packetAt += _sentPackets.size();
}
return &_sentPackets.at(packetAt);
}

View file

@ -2123,7 +2123,7 @@ void Application::sendNack() {
QUuid nodeUUID = node->getUUID();
_octreeSceneStatsLock.lockForWrite();
_octreeSceneStatsLock.lockForRead();
// retreive octree scene stats of this node
if (_octreeServerSceneStats.find(nodeUUID) == _octreeServerSceneStats.end()) {