mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 18:13:05 +02:00
move the NodeList to the thread used for a ThreadedAssignment
This commit is contained in:
parent
e888366fd8
commit
fa01383f3f
4 changed files with 10 additions and 5 deletions
|
@ -148,6 +148,9 @@ void AssignmentClient::readPendingDatagrams() {
|
||||||
|
|
||||||
_currentAssignment->moveToThread(workerThread);
|
_currentAssignment->moveToThread(workerThread);
|
||||||
|
|
||||||
|
// move the NodeList to the thread used for the _current assignment
|
||||||
|
nodeList->moveToThread(workerThread);
|
||||||
|
|
||||||
// Starts an event loop, and emits workerThread->started()
|
// Starts an event loop, and emits workerThread->started()
|
||||||
workerThread->start();
|
workerThread->start();
|
||||||
} else {
|
} else {
|
||||||
|
@ -172,6 +175,9 @@ void AssignmentClient::assignmentCompleted() {
|
||||||
|
|
||||||
NodeList* nodeList = NodeList::getInstance();
|
NodeList* nodeList = NodeList::getInstance();
|
||||||
|
|
||||||
|
// move the NodeList back to our thread
|
||||||
|
nodeList->moveToThread(thread());
|
||||||
|
|
||||||
// reset our NodeList by switching back to unassigned and clearing the list
|
// reset our NodeList by switching back to unassigned and clearing the list
|
||||||
nodeList->setOwnerType(NODE_TYPE_UNASSIGNED);
|
nodeList->setOwnerType(NODE_TYPE_UNASSIGNED);
|
||||||
nodeList->reset();
|
nodeList->reset();
|
||||||
|
|
|
@ -39,7 +39,7 @@ Node::Node(const QUuid& uuid, char type, const HifiSockAddr& publicSocket, const
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Node::~Node() {
|
Node::~Node() {
|
||||||
if (_linkedData) {
|
if (_linkedData) {
|
||||||
_linkedData->deleteOrDeleteLater();
|
_linkedData->deleteOrDeleteLater();
|
||||||
}
|
}
|
||||||
|
|
|
@ -789,7 +789,6 @@ void NodeList::removeSilentNodes() {
|
||||||
NodeHash::iterator nodeItem = _nodeHash.begin();
|
NodeHash::iterator nodeItem = _nodeHash.begin();
|
||||||
|
|
||||||
while (nodeItem != _nodeHash.end()) {
|
while (nodeItem != _nodeHash.end()) {
|
||||||
|
|
||||||
SharedNodePointer node = nodeItem.value();
|
SharedNodePointer node = nodeItem.value();
|
||||||
|
|
||||||
QMutexLocker(&node->getMutex());
|
QMutexLocker(&node->getMutex());
|
||||||
|
|
|
@ -41,9 +41,9 @@ void ThreadedAssignment::commonInit(const char* targetName, NODE_TYPE nodeType)
|
||||||
connect(pingNodesTimer, SIGNAL(timeout()), nodeList, SLOT(pingInactiveNodes()));
|
connect(pingNodesTimer, SIGNAL(timeout()), nodeList, SLOT(pingInactiveNodes()));
|
||||||
pingNodesTimer->start(PING_INACTIVE_NODE_INTERVAL_USECS / 1000);
|
pingNodesTimer->start(PING_INACTIVE_NODE_INTERVAL_USECS / 1000);
|
||||||
|
|
||||||
QTimer* silentNodeTimer = new QTimer(this);
|
QTimer* silentNodeRemovalTimer = new QTimer(this);
|
||||||
connect(silentNodeTimer, SIGNAL(timeout()), nodeList, SLOT(removeSilentNodes()));
|
connect(silentNodeRemovalTimer, SIGNAL(timeout()), nodeList, SLOT(removeSilentNodes()));
|
||||||
silentNodeTimer->start(NODE_SILENCE_THRESHOLD_USECS / 1000);
|
silentNodeRemovalTimer->start(NODE_SILENCE_THRESHOLD_USECS / 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ThreadedAssignment::checkInWithDomainServerOrExit() {
|
void ThreadedAssignment::checkInWithDomainServerOrExit() {
|
||||||
|
|
Loading…
Reference in a new issue