mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 11:07:07 +02:00
Add missing read locks to LimitedNodeList's hash
This commit is contained in:
parent
d78eb19e44
commit
70cf25bd8b
2 changed files with 3 additions and 2 deletions
|
@ -522,6 +522,7 @@ SharedNodePointer LimitedNodeList::addOrUpdateNode(const QUuid& uuid, NodeType_t
|
||||||
const HifiSockAddr& publicSocket, const HifiSockAddr& localSocket,
|
const HifiSockAddr& publicSocket, const HifiSockAddr& localSocket,
|
||||||
const NodePermissions& permissions,
|
const NodePermissions& permissions,
|
||||||
const QUuid& connectionSecret) {
|
const QUuid& connectionSecret) {
|
||||||
|
QReadLocker readLocker(&_nodeMutex);
|
||||||
NodeHash::const_iterator it = _nodeHash.find(uuid);
|
NodeHash::const_iterator it = _nodeHash.find(uuid);
|
||||||
|
|
||||||
if (it != _nodeHash.end()) {
|
if (it != _nodeHash.end()) {
|
||||||
|
|
|
@ -131,7 +131,7 @@ public:
|
||||||
|
|
||||||
std::function<void(Node*)> linkedDataCreateCallback;
|
std::function<void(Node*)> linkedDataCreateCallback;
|
||||||
|
|
||||||
size_t size() const { return _nodeHash.size(); }
|
size_t size() const { QReadLocker readLock(&_nodeMutex); return _nodeHash.size(); }
|
||||||
|
|
||||||
SharedNodePointer nodeWithUUID(const QUuid& nodeUUID);
|
SharedNodePointer nodeWithUUID(const QUuid& nodeUUID);
|
||||||
|
|
||||||
|
@ -287,7 +287,7 @@ protected:
|
||||||
|
|
||||||
QUuid _sessionUUID;
|
QUuid _sessionUUID;
|
||||||
NodeHash _nodeHash;
|
NodeHash _nodeHash;
|
||||||
QReadWriteLock _nodeMutex;
|
mutable QReadWriteLock _nodeMutex;
|
||||||
udt::Socket _nodeSocket;
|
udt::Socket _nodeSocket;
|
||||||
QUdpSocket* _dtlsSocket;
|
QUdpSocket* _dtlsSocket;
|
||||||
HifiSockAddr _localSockAddr;
|
HifiSockAddr _localSockAddr;
|
||||||
|
|
Loading…
Reference in a new issue