mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:44:02 +02:00
Don't grab subTree outside lock
This commit is contained in:
parent
4aaa9ca02f
commit
0bc914bf19
1 changed files with 6 additions and 1 deletions
|
@ -417,10 +417,15 @@ int OctreeSendThread::packetDistributor(OctreeQueryNode* nodeData, bool viewFrus
|
|||
quint64 startInside = usecTimestampNow();
|
||||
|
||||
bool lastNodeDidntFit = false; // assume each node fits
|
||||
if (OctreeElementPointer subTree = nodeData->elementBag.extract()) {
|
||||
if (!nodeData->elementBag.isEmpty()) {
|
||||
|
||||
quint64 lockWaitStart = usecTimestampNow();
|
||||
_myServer->getOctree()->withReadLock([&]{
|
||||
OctreeElementPointer subTree = nodeData->elementBag.extract();
|
||||
if (!subTree) {
|
||||
return;
|
||||
}
|
||||
|
||||
quint64 lockWaitEnd = usecTimestampNow();
|
||||
lockWaitElapsedUsec = (float)(lockWaitEnd - lockWaitStart);
|
||||
quint64 encodeStart = usecTimestampNow();
|
||||
|
|
Loading…
Reference in a new issue