VirtualBox

Changeset 50000 in vbox for trunk/src/VBox/VMM/VMMAll


Ignore:
Timestamp:
Dec 24, 2013 9:03:10 PM (11 years ago)
Author:
vboxsync
Message:

pdmR3R0CritSectEnterContended: That worked but wasn't entirely correct, so next attempt.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/PDMAllCritSect.cpp

    r49999 r50000  
    114114 * @retval  VINF_SUCCESS on success.
    115115 * @retval  VERR_SEM_DESTROYED if destroyed.
    116  * @retval  VERR_INTERRUPTED in ring-0 if we should return rcBusy or jump to
    117  *          ring-3.
    118116 *
    119117 * @param   pCritSect           The critsect.
     
    184182            return pdmCritSectEnterFirst(pCritSect, hNativeSelf, pSrcPos);
    185183        AssertMsg(rc == VERR_INTERRUPTED, ("rc=%Rrc\n", rc));
     184
    186185# ifdef IN_RING0
    187         return VERR_INTERRUPTED;
     186        /* Something is pending (signal, APC, debugger, whatever), just go back
     187           to ring-3 so the kernel can deal with it when leaving kernel context.
     188
     189           Note! We've incremented cLockers already and cannot safely decrement
     190                 it without creating a race with PDMCritSectLeave, resulting in
     191                 spurious wakeups. */
     192        PVM     pVM   = pCritSect->s.CTX_SUFF(pVM); AssertPtr(pVM);
     193        PVMCPU  pVCpu = VMMGetCpu(pVM);             AssertPtr(pVCpu);
     194        rc = VMMRZCallRing3(pVM, pVCpu, VMMCALLRING3_VM_R0_PREEMPT, NULL);
     195        AssertRC(rc);
    188196# endif
    189197    }
     
    306314    if (   RTThreadPreemptIsEnabled(NIL_RTTHREAD)
    307315        && ASMIntAreEnabled())
    308     {
    309         int rc = pdmR3R0CritSectEnterContended(pCritSect, hNativeSelf, pSrcPos);
    310         if (rc != VERR_INTERRUPTED)
    311             return rc;
    312     }
     316        return pdmR3R0CritSectEnterContended(pCritSect, hNativeSelf, pSrcPos);
    313317#  endif
    314318#endif /* IN_RING0 */
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