History

move the NodeList to the thread used for a ThreadedAssignment

Stephen Birarda committed 12 years ago

Commit fa013831 parent e8883664 files · +10 −5Browse files

Showing the changes to assignment-client/src/AssignmentClient.cpp (1 of 4 files). Show all

Unified · Split

assignment-client/src/AssignmentClient.cpp+6−0
@@ -148,6 +148,9 @@ void AssignmentClient::readPendingDatagrams() { · 147 unmodified lines
148 148
149 _currentAssignment->moveToThread(workerThread);149 _currentAssignment->moveToThread(workerThread);
150 150
151 // move the NodeList to the thread used for the _current assignment
152 nodeList->moveToThread(workerThread);
153
151 // Starts an event loop, and emits workerThread->started()154 // Starts an event loop, and emits workerThread->started()
152 workerThread->start();155 workerThread->start();
153 } else {156 } else {
@@ -172,6 +175,9 @@ void AssignmentClient::assignmentCompleted() { · 18 unmodified lines
172 175
173 NodeList* nodeList = NodeList::getInstance();176 NodeList* nodeList = NodeList::getInstance();
174 177
178 // move the NodeList back to our thread
179 nodeList->moveToThread(thread());
180
175 // reset our NodeList by switching back to unassigned and clearing the list181 // reset our NodeList by switching back to unassigned and clearing the list
176 nodeList->setOwnerType(NODE_TYPE_UNASSIGNED);182 nodeList->setOwnerType(NODE_TYPE_UNASSIGNED);
177 nodeList->reset();183 nodeList->reset();