mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 05:17:24 +02:00
Fix potential race in NodeList
This commit is contained in:
parent
001cfc7e15
commit
384f3d9321
2 changed files with 4 additions and 4 deletions
|
@ -350,7 +350,7 @@ void NodeList::sendDomainServerCheckIn() {
|
||||||
|
|
||||||
// pack our data to send to the domain-server including
|
// pack our data to send to the domain-server including
|
||||||
// the hostname information (so the domain-server can see which place name we came in on)
|
// the hostname information (so the domain-server can see which place name we came in on)
|
||||||
packetStream << _ownerType << _publicSockAddr << _localSockAddr << _nodeTypesOfInterest.toList();
|
packetStream << _ownerType.load() << _publicSockAddr << _localSockAddr << _nodeTypesOfInterest.toList();
|
||||||
packetStream << DependencyManager::get<AddressManager>()->getPlaceName();
|
packetStream << DependencyManager::get<AddressManager>()->getPlaceName();
|
||||||
|
|
||||||
if (!_domainHandler.isConnected()) {
|
if (!_domainHandler.isConnected()) {
|
||||||
|
|
|
@ -51,8 +51,8 @@ class NodeList : public LimitedNodeList {
|
||||||
SINGLETON_DEPENDENCY
|
SINGLETON_DEPENDENCY
|
||||||
|
|
||||||
public:
|
public:
|
||||||
NodeType_t getOwnerType() const { return _ownerType; }
|
NodeType_t getOwnerType() const { return _ownerType.load(); }
|
||||||
void setOwnerType(NodeType_t ownerType) { _ownerType = ownerType; }
|
void setOwnerType(NodeType_t ownerType) { _ownerType.store(ownerType); }
|
||||||
|
|
||||||
Q_INVOKABLE qint64 sendStats(QJsonObject statsObject, HifiSockAddr destination);
|
Q_INVOKABLE qint64 sendStats(QJsonObject statsObject, HifiSockAddr destination);
|
||||||
Q_INVOKABLE qint64 sendStatsToDomainServer(QJsonObject statsObject);
|
Q_INVOKABLE qint64 sendStatsToDomainServer(QJsonObject statsObject);
|
||||||
|
@ -134,7 +134,7 @@ private:
|
||||||
|
|
||||||
bool sockAddrBelongsToDomainOrNode(const HifiSockAddr& sockAddr);
|
bool sockAddrBelongsToDomainOrNode(const HifiSockAddr& sockAddr);
|
||||||
|
|
||||||
NodeType_t _ownerType;
|
std::atomic<NodeType_t> _ownerType;
|
||||||
NodeSet _nodeTypesOfInterest;
|
NodeSet _nodeTypesOfInterest;
|
||||||
DomainHandler _domainHandler;
|
DomainHandler _domainHandler;
|
||||||
int _numNoReplyDomainCheckIns;
|
int _numNoReplyDomainCheckIns;
|
||||||
|
|
Loading…
Reference in a new issue