VirtualBox

Ignore:
Timestamp:
Jun 24, 2010 1:41:39 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
63077
Message:

Guest Control/VBoxService: Signal control thread after executable has been spawned (or something went wrong). Should deal with #5068c14 on Open Solaris.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControlExec.cpp

    r30013 r30436  
    796796    AssertPtr(pData);
    797797
    798     /*
    799      * Tell the control thread that it can continue
    800      * spawning services.
    801      */
    802     RTThreadUserSignal(RTThreadSelf());
    803798    VBoxServiceVerbose(3, "ControlExec: Thread of process \"%s\" started\n", pData->pszCmd);
    804799
     
    807802    {
    808803        VBoxServiceError("ControlExec: Thread failed to connect to the guest control service, aborted! Error: %Rrc\n", rc);
     804        RTThreadUserSignal(RTThreadSelf());
    809805        return rc;
    810806    }
     807
     808    bool fSignalled = false; /* Indicator whether we signalled the thread user event already. */
    811809
    812810    /*
     
    868866                                                                         pData->pszUser, pData->pszPassword,
    869867                                                                         &hProcess);
     868
     869                                /*
     870                                 * Tell the control thread that it can continue
     871                                 * spawning services. This needs to be done after the new
     872                                 * process has been started because otherwise signal handling
     873                                 * on (Open) Solaris does not work correctly (see #5068).
     874                                 */
     875                                int rc2 = RTThreadUserSignal(RTThreadSelf());
     876                                if (RT_FAILURE(rc2))
     877                                    rc = rc2;
     878                                fSignalled = true;
     879
    870880                                if (RT_SUCCESS(rc))
    871881                                {
     
    928938    VBoxServiceVerbose(3, "ControlExec: Thread of process \"%s\" (PID: %u) ended with rc=%Rrc\n",
    929939                       pData->pszCmd, pData->uPID, rc);
     940
     941    /*
     942     * If something went wrong signal the user event so that others don't wait
     943     * forever on this thread.
     944     */
     945    if (RT_FAILURE(rc) && !fSignalled)
     946        RTThreadUserSignal(RTThreadSelf());
    930947    return rc;
    931948}
     
    967984            else
    968985            {
     986                VBoxServiceVerbose(4, "ControlExec: Waiting for thread to initialize ...\n");
     987
    969988                /* Wait for the thread to initialize. */
    970989                RTThreadUserWait(pThread->Thread, 60 * 1000);
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette