Changeset 15604 in vbox for trunk/src/VBox/Main
- Timestamp:
- Dec 16, 2008 7:20:17 PM (16 years ago)
- Location:
- trunk/src/VBox/Main/xpcom
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/xpcom/server.cpp
r15570 r15604 338 338 339 339 FinalRelease(); 340 sInstance = 0;340 sInstance = NULL; 341 341 342 342 LogFlowFunc (("VirtualBox object deleted.\n")); … … 362 362 PRBool timerStarted = PR_FALSE; 363 363 364 /* sTimes is null if this call originates from 365 * FactoryDestructor() */ 364 /* sTimer is null if this call originates from FactoryDestructor()*/ 366 365 if (sTimer != NULL) 367 366 { … … 456 455 else 457 456 { 458 /* This condition is quite rare: a new client will haveto457 /* This condition is quite rare: a new client happened to 459 458 * connect after this event has been posted to the main queue 460 459 * but before it started to process it. */ … … 516 515 RTCritSectDelete (&sLock); 517 516 518 if (sInstance )517 if (sInstance != NULL) 519 518 { 520 519 /* Either posting a destruction event falied for some reason (most … … 535 534 RTCritSectEnter (&sLock); 536 535 537 int rv = NS_OK; 538 539 if (sInstance == 0) 536 if (!gKeepRunning) 537 { 538 LogFlowFunc (("Process termination requested first. Refusing.\n")); 539 540 RTCritSectLeave (&sLock); 541 542 /* this rv is what CreateInstance() on the client side returns 543 * when the server process stops accepting events. Do the same 544 * here. The client wrapper should attempt to start a new process in 545 * response to a failure from us. */ 546 return NS_ERROR_ABORT; 547 } 548 549 nsresult rv = NS_OK; 550 551 if (sInstance == NULL) 540 552 { 541 553 LogFlowFunc (("Creating new VirtualBox object...\n")); 542 554 sInstance = new VirtualBoxClassFactory(); 543 if (sInstance )555 if (sInstance != NULL) 544 556 { 545 557 /* make an extra AddRef to take the full control … … 563 575 sInstance->Release(); 564 576 sInstance->Release(); 565 Assert (sInstance == 0);577 Assert (sInstance == NULL); 566 578 } 567 579 else … … 614 626 }; 615 627 616 VirtualBoxClassFactory *VirtualBoxClassFactory::sInstance = 0;628 VirtualBoxClassFactory *VirtualBoxClassFactory::sInstance = NULL; 617 629 RTCRITSECT VirtualBoxClassFactory::sLock = {0}; 618 630 … … 1152 1164 } 1153 1165 1166 /* stop accepting new events. Clients that happen to resolve our 1167 * name and issue a CreateInstance() request after this point will 1168 * get NS_ERROR_ABORT once we hande the remaining messages. As a 1169 * result, they should try to start a new server process. */ 1170 gEventQ->StopAcceptingEvents(); 1171 1172 /* unregister ourselves. After this point, clients will start a new 1173 * process because they won't be able to resolve the server name.*/ 1154 1174 gIpcServ->RemoveName (VBOXSVC_IPC_NAME); 1155 1175 1156 /* stop accepting new events */1157 gEventQ->StopAcceptingEvents();1158 1159 /* process any remaining events*/1176 /* process any remaining events. These events may include 1177 * CreateInstance() requests received right before we called 1178 * StopAcceptingEvents() above. We will detect this case below, 1179 * restore gKeepRunning and continue to serve. */ 1160 1180 gEventQ->ProcessPendingEvents(); 1161 1181 -
trunk/src/VBox/Main/xpcom/server_module.cpp
r14323 r15604 229 229 break; 230 230 231 LogFlowFunc (("Failed to connect (rc=%Rhrc (%#08x))\n", rc, rc)); 232 231 233 /* It's possible that the server gets shut down after we 232 234 * successfully resolve the server name but before it … … 239 241 if (NS_SUCCEEDED (rc2)) 240 242 break; 243 244 LogFlowFunc (("Server seems to have terminated before " 245 "receiving our request. Will try again.\n")); 241 246 } 242 247 else … … 247 252 while (0); 248 253 249 LogFlowFunc (("rc=% 08X, vrc=%Rrc\n", rc, vrc));254 LogFlowFunc (("rc=%Rhrc (%#08x), vrc=%Rrc\n", rc, rc, vrc)); 250 255 LogFlowFuncLeave(); 251 256
Note:
See TracChangeset
for help on using the changeset viewer.