VirtualBox

Ignore:
Timestamp:
Dec 16, 2013 5:13:59 PM (11 years ago)
Author:
vboxsync
Message:

Main/src-server/win/HostPowerWin.cpp: fix long standing bug which caused VBoxSVC to hang around for 5 seconds as the thread termination notification wasn't posted properly
Main/src-server/win/svcmain.cpp: reduced "just in case" sleep, shouldn't be necessary at all, when threads using COM are present the server shouldn't ever get to this place
Runtime/common/log/log.cpp: if there are sharing problems with the log file to be opened, wait for up to 10 seconds, maybe the previous user goes away (helps with VBoxSVC release log which can cause trouble, when the previous process is not quite terminated and some API client triggers the launch of a new one), effectively Windows only

Location:
trunk/src/VBox/Main/src-server/win
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/win/HostPowerWin.cpp

    r46775 r49938  
    5454        /* Is this allowed from another thread? */
    5555        SetWindowLongPtr(mHwnd, 0, 0);
    56         /* Send the quit message and wait for it be processed. */
    57         SendMessage(mHwnd, WM_QUIT, 0, 0);
     56        /* Poke the thread out of the event loop and wait for it to clean up. */
     57        PostMessage(mHwnd, WM_QUIT, 0, 0);
    5858        RTThreadWait(mThread, 5000, NULL);
    5959        mThread = NIL_RTTHREAD;
     
    114114
    115115            MSG msg;
    116             while (GetMessage(&msg, NULL, 0, 0))
     116            BOOL fRet;
     117            while ((fRet = GetMessage(&msg, NULL, 0, 0)) != 0)
    117118            {
    118                 TranslateMessage(&msg);
    119                 DispatchMessage(&msg);
     119                if (fRet != -1)
     120                {
     121                    TranslateMessage(&msg);
     122                    DispatchMessage(&msg);
     123                }
     124                else
     125                {
     126                    // handle the error and possibly exit
     127                    break;
     128                }
    120129            }
    121130        }
  • trunk/src/VBox/Main/src-server/win/svcmain.cpp

    r47525 r49938  
    55
    66/*
    7  * Copyright (C) 2004-2012 Oracle Corporation
     7 * Copyright (C) 2004-2013 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    5757
    5858const DWORD dwTimeOut = 5000; /* time for EXE to be idle before shutting down */
    59 const DWORD dwPause = 1000; /* time to wait for threads to finish up */
     59const DWORD dwPause = 100; /* time to wait for threads to finish up */
    6060
    6161/* Passed to CreateThread to monitor the shutdown event */
Note: See TracChangeset for help on using the changeset viewer.

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