- Timestamp:
- Apr 4, 2020 1:29:02 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControlSession.cpp
r83553 r83554 1623 1623 } 1624 1624 1625 VGSvcVerbose(3, "Guest session ID=%RU32 thread ended with sessionStatus=%RU32, sessionRc=%Rrc\n", 1626 idSession, uSessionStatus, uSessionRc); 1627 1628 /* 1629 * Report final status. 1630 */ 1625 /* Make sure to set stopped state before we let the host know. */ 1626 ASMAtomicWriteBool(&pThread->fStopped, true); 1627 1628 /* Report final status, regardless if we failed to wait above, so that the host knows what's going on. */ 1629 VGSvcVerbose(3, "Reporting final status %RU32 of session ID=%RU32\n", uSessionStatus, idSession); 1631 1630 Assert(uSessionStatus != GUEST_SESSION_NOTIFYTYPE_UNDEFINED); 1632 VBGLR3GUESTCTRLCMDCTX ctx = { idClient, VBOX_GUESTCTRL_CONTEXTID_MAKE_SESSION(idSession), 1633 0 /* uProtocol, unused */, 0 /* uNumParms, unused */};1631 1632 VBGLR3GUESTCTRLCMDCTX ctx = { g_idControlSvcClient, VBOX_GUESTCTRL_CONTEXTID_MAKE_SESSION(idSession)}; 1634 1633 rc2 = VbglR3GuestCtrlSessionNotify(&ctx, uSessionStatus, uSessionRc); 1635 1634 if (RT_FAILURE(rc2)) 1636 VGSvcError("Reporting session ID=%RU32 final status failed with rc=%Rrc\n", idSession, rc2); 1637 1638 VGSvcVerbose(3, "Session ID=%RU32 thread ending\n", idSession); 1635 VGSvcError("Reporting final status of session ID=%RU32 failed with rc=%Rrc\n", idSession, rc2); 1636 1637 VGSvcVerbose(3, "Thread for session ID=%RU32 ended with sessionStatus=%RU32, sessionRc=%Rrc\n", 1638 idSession, uSessionStatus, uSessionRc); 1639 1639 1640 return VINF_SUCCESS; 1640 1641 } … … 2390 2391 RTListForEach(pList, pSessionCur, VBOXSERVICECTRLSESSIONTHREAD, Node) 2391 2392 { 2392 AssertMsgReturn(pSessionCur->StartupInfo.uSessionID != pSessionStartupInfo->uSessionID, 2393 ("Guest session thread ID=%RU32 (%p) already exists when it should not\n", 2394 pSessionCur->StartupInfo.uSessionID, pSessionCur), VERR_ALREADY_EXISTS); 2393 AssertMsgReturn( pSessionCur->fStopped == true 2394 || pSessionCur->StartupInfo.uSessionID != pSessionStartupInfo->uSessionID, 2395 ("Guest session thread ID=%RU32 already exists (fStopped=%RTbool)\n", 2396 pSessionCur->StartupInfo.uSessionID, pSessionCur->fStopped), VERR_ALREADY_EXISTS); 2395 2397 } 2396 2398 #endif … … 2545 2547 rc = RTThreadWait(pThread->Thread, uTimeoutMS, &rcThread); 2546 2548 if (RT_SUCCESS(rc)) 2549 { 2550 AssertMsg(pThread->fStopped, ("Thread of session ID=%RU32 not in stopped state when it should\n", 2551 pThread->StartupInfo.uSessionID)); 2552 2547 2553 VGSvcVerbose(3, "Session thread ID=%RU32 ended with rc=%Rrc\n", pThread->StartupInfo.uSessionID, rcThread); 2554 } 2548 2555 else 2549 2556 VGSvcError("Waiting for session thread ID=%RU32 to close failed with rc=%Rrc\n", pThread->StartupInfo.uSessionID, rc); 2550 2557 } 2551 2558 else 2559 VGSvcVerbose(3, "Thread for session ID=%RU32 not in started state, skipping wait\n", pThread->StartupInfo.uSessionID); 2560 2561 LogFlowFuncLeaveRC(rc); 2552 2562 return rc; 2553 2563 } … … 2565 2575 AssertPtrReturn(pThread, VERR_INVALID_POINTER); 2566 2576 2577 const uint32_t uSessionID = pThread->StartupInfo.uSessionID; 2578 2579 VGSvcVerbose(3, "Destroying session ID=%RU32 ...\n", uSessionID); 2580 2567 2581 int rc = VGSvcGstCtrlSessionThreadWait(pThread, 5 * 60 * 1000 /* 5 minutes timeout */, fFlags); 2568 2569 /* Remove session from list and destroy object. */ 2570 RTListNodeRemove(&pThread->Node); 2571 2572 RTMemFree(pThread); 2573 pThread = NULL; 2574 2582 if (RT_SUCCESS(rc)) 2583 { 2584 /* Remove session from list and destroy object. */ 2585 RTListNodeRemove(&pThread->Node); 2586 2587 RTMemFree(pThread); 2588 pThread = NULL; 2589 } 2590 2591 VGSvcVerbose(3, "Destroyed session ID=%RU32 with %Rrc\n", uSessionID, rc); 2575 2592 return rc; 2576 2593 }
Note:
See TracChangeset
for help on using the changeset viewer.