Changeset 28446 in vbox for trunk/src/VBox/Additions/common
- Timestamp:
- Apr 19, 2010 8:45:03 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControl.cpp
r28434 r28446 240 240 static DECLCALLBACK(void) VBoxServiceControlTerm(void) 241 241 { 242 /* Shutdown spawned processes threads. */ 243 PVBOXSERVICECTRLTHREAD pNode = RTListNodeGetFirst(&g_GuestControlExecThreads, VBOXSERVICECTRLTHREAD, Node); 244 while (pNode) 245 { 242 /* Signal all threads that we want to shutdown. */ 243 PVBOXSERVICECTRLTHREAD pNode; 244 RTListForEach(&g_GuestControlExecThreads, pNode, VBOXSERVICECTRLTHREAD, Node) 246 245 ASMAtomicXchgBool(&pNode->fShutdown, true); 247 if (RTListNodeIsLast(&g_GuestControlExecThreads, &pNode->Node)) 248 break; 249 pNode = RTListNodeGetNext(&pNode->Node, VBOXSERVICECTRLTHREAD, Node); 250 } 251 252 pNode = RTListNodeGetFirst(&g_GuestControlExecThreads, VBOXSERVICECTRLTHREAD, Node); 253 while (pNode) 246 247 /* Wait for threads to shutdown. */ 248 RTListForEach(&g_GuestControlExecThreads, pNode, VBOXSERVICECTRLTHREAD, Node) 254 249 { 255 250 if (pNode->Thread != NIL_RTTHREAD) … … 260 255 } 261 256 VBoxServiceControlExecDestroyThreadData(pNode); 262 if (RTListNodeIsLast(&g_GuestControlExecThreads, &pNode->Node)) 263 break; 264 pNode = RTListNodeGetNext(&pNode->Node, VBOXSERVICECTRLTHREAD, Node); 265 } 266 257 } 258 259 /* Finally destroy thread list. */ 267 260 pNode = RTListNodeGetFirst(&g_GuestControlExecThreads, VBOXSERVICECTRLTHREAD, Node); 268 261 while (pNode) 269 262 { 263 PVBOXSERVICECTRLTHREAD pNext = RTListNodeGetNext(&pNode->Node, VBOXSERVICECTRLTHREAD, Node); 264 270 265 RTListNodeRemove(&pNode->Node); 271 266 RTMemFree(pNode); 272 if (RTListNodeIsLast(&g_GuestControlExecThreads, &pNode->Node)) 267 268 if (pNext && RTListNodeIsLast(&g_GuestControlExecThreads, &pNext->Node)) 273 269 break; 274 270 275 PVBOXSERVICECTRLTHREAD pNext = RTListNodeGetNext(&pNode->Node, VBOXSERVICECTRLTHREAD, Node);276 271 pNode = pNext; 277 272 }
Note:
See TracChangeset
for help on using the changeset viewer.