VirtualBox

Changeset 21555 in vbox for trunk/src/VBox/Runtime/r0drv


Ignore:
Timestamp:
Jul 13, 2009 4:51:25 PM (16 years ago)
Author:
vboxsync
Message:

semspinmutex-r0drv-generic.c: better fix.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r0drv/generic/semspinmutex-r0drv-generic.c

    r21554 r21555  
    7979     * This is NIL if the semaphore is not owned by anyone. */
    8080    RTNATIVETHREAD volatile hOwner;
    81     /** Number of threads waiting for the lock. */
     81    /** Number of threads that are fighting for the lock. */
    8282    int32_t volatile        cLockers;
    8383    /** The semaphore to block on. */
     
    126126    pThis->fFlags    = fFlags;
    127127    pThis->hOwner    = NIL_RTNATIVETHREAD;
    128     pThis->cLockers  = -1;
     128    pThis->cLockers  = 0;
    129129    rc = RTSemEventCreate(&pThis->hEventSem);
    130130    if (RT_SUCCESS(rc))
     
    401401    cLockers = ASMAtomicDecS32(&pThis->cLockers);
    402402    rtSemSpinMutexLeave(&State);
    403     if (cLockers >= 0)
     403    if (cLockers > 0)
    404404    {
    405405        int rc = RTSemEventSignal(pThis->hEventSem);
     
    423423
    424424    /* No destruction races allowed! */
    425     AssertMsg(   pThis->cLockers  == -1
     425    AssertMsg(   pThis->cLockers  == 0
    426426              && pThis->hOwner    == NIL_RTNATIVETHREAD,
    427427              ("pThis=%p cLockers=%d hOwner=%p\n", pThis, pThis->cLockers, pThis->hOwner));
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