VirtualBox

Changeset 38315 in vbox for trunk/src/VBox/Additions


Ignore:
Timestamp:
Aug 4, 2011 2:07:14 PM (14 years ago)
Author:
vboxsync
Message:

crogl: send WM_SETTINGCHANGE outside the hashtable lock to avoid redraw deadlocking

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/crOpenGL/load.c

    r37708 r38315  
    770770}
    771771
     772typedef struct VBOXCR_UPDATEWNDCB
     773{
     774    VBOXDISPMP_REGIONS Regions;
     775    bool fSendUpdateMsg;
     776} VBOXCR_UPDATEWNDCB, *PVBOXCR_UPDATEWNDCB;
     777
    772778static void stubSyncTrUpdateWindowCB(unsigned long key, void *data1, void *data2)
    773779{
    774780    WindowInfo *pWindow = (WindowInfo *) data1;
    775     VBOXDISPMP_REGIONS *pRegions = (VBOXDISPMP_REGIONS*) data2;
     781    PVBOXCR_UPDATEWNDCB pCbData = (PVBOXCR_UPDATEWNDCB) data2;
     782    VBOXDISPMP_REGIONS *pRegions = &pCbData->Regions;
    776783    bool bChanged = false;
    777784    HRGN hNewRgn = INVALID_HANDLE_VALUE;
     
    866873                if (pWindow->hVisibleRegion==INVALID_HANDLE_VALUE || EqualRgn(pWindow->hVisibleRegion, hEmptyRgn))
    867874                {
    868                     SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0, 0, SMTO_NORMAL, 1000, NULL);
     875                    pCbData->fSendUpdateMsg = true;
    869876                }
    870877
     
    951958    static VBOXDISPMP_CALLBACKS VBoxDispMpTstCallbacks = {NULL, NULL, NULL};
    952959    HMODULE hVBoxD3D = NULL;
    953     VBOXDISPMP_REGIONS Regions;
     960    VBOXCR_UPDATEWNDCB RegionsData;
    954961    HRESULT hr;
    955962# endif
     
    10161023            if (VBoxDispMpTstCallbacks.pfnGetRegions)
    10171024            {
    1018                 hr = VBoxDispMpTstCallbacks.pfnGetRegions(&Regions, 50);
     1025                hr = VBoxDispMpTstCallbacks.pfnGetRegions(&RegionsData.Regions, 50);
    10191026                if (S_OK==hr)
    10201027                {
     1028                    RegionsData.fSendUpdateMsg = false;
    10211029#  if 0
    10221030                    uint32_t i;
    1023                     crDebug(">>>Regions for HWND(0x%x)>>>", Regions.hWnd);
    1024                     crDebug("Flags(0x%x)", Regions.pRegions->fFlags.Value);
    1025                     for (i = 0; i < Regions.pRegions->RectsInfo.cRects; ++i)
     1031                    crDebug(">>>Regions for HWND(0x%x)>>>", RegionsData.Regions.hWnd);
     1032                    crDebug("Flags(0x%x)", RegionsData.Regions.pRegions->fFlags.Value);
     1033                    for (i = 0; i < RegionsData.Regions.pRegions->RectsInfo.cRects; ++i)
    10261034                    {
    1027                         RECT *pRect = &Regions.pRegions->RectsInfo.aRects[i];
     1035                        RECT *pRect = &RegionsData.Regions.pRegions->RectsInfo.aRects[i];
    10281036                        crDebug("Rect(%d): left(%d), top(%d), right(%d), bottom(%d)", i, pRect->left, pRect->top, pRect->right, pRect->bottom);
    10291037                    }
     
    10311039#  endif
    10321040                    /*hacky way to make sure window wouldn't be deleted in another thread as we hold hashtable lock here*/
    1033                     crHashtableWalk(stub.windowTable, stubSyncTrUpdateWindowCB, &Regions);
     1041                    crHashtableWalk(stub.windowTable, stubSyncTrUpdateWindowCB, &RegionsData);
     1042                    if (RegionsData.fSendUpdateMsg)
     1043                    {
     1044                        SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0, 0, SMTO_NORMAL, 1000, NULL);
     1045                    }
    10341046                }
    10351047                else
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