VirtualBox

Changeset 19740 in vbox


Ignore:
Timestamp:
May 15, 2009 2:32:46 PM (16 years ago)
Author:
vboxsync
Message:

PDMAllCritSect.cpp: Use ASMAtomicWriteHandle.

File:
1 edited

Legend:

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

    r19720 r19740  
    7878        pCritSect->s.Core.cNestings = 1;
    7979        Assert(pVCpu->hNativeThread != NIL_RTNATIVETHREAD);
    80         ASMAtomicXchgSize(&pCritSect->s.Core.NativeThreadOwner, pVCpu->hNativeThread);
     80        ASMAtomicWriteHandle(&pCritSect->s.Core.NativeThreadOwner, pVCpu->hNativeThread);
    8181        STAM_PROFILE_ADV_START(&pCritSect->s.StatLocked, l);
    8282        return VINF_SUCCESS;
     
    132132        pCritSect->s.Core.cNestings = 1;
    133133        Assert(pVCpu->hNativeThread != NIL_RTNATIVETHREAD);
    134         ASMAtomicXchgSize(&pCritSect->s.Core.NativeThreadOwner, pVCpu->hNativeThread);
     134        ASMAtomicWriteHandle(&pCritSect->s.Core.NativeThreadOwner, pVCpu->hNativeThread);
    135135        STAM_PROFILE_ADV_START(&pCritSect->s.StatLocked, l);
    136136        return VINF_SUCCESS;
     
    176176    {
    177177        RTThreadWriteLockDec(pCritSect->s.Core.Strict.ThreadOwner);
    178         ASMAtomicXchgSize(&pCritSect->s.Core.Strict.ThreadOwner, NIL_RTTHREAD);
     178        ASMAtomicWriteHandle(&pCritSect->s.Core.Strict.ThreadOwner, NIL_RTTHREAD);
    179179    }
    180180    return rc;
     
    244244    {
    245245        STAM_PROFILE_ADV_STOP(&pCritSect->s.StatLocked, l);
    246         ASMAtomicXchgSize(&pCritSect->s.Core.NativeThreadOwner, NIL_RTNATIVETHREAD);
     246        ASMAtomicWriteHandle(&pCritSect->s.Core.NativeThreadOwner, NIL_RTNATIVETHREAD);
    247247        if (ASMAtomicCmpXchgS32(&pCritSect->s.Core.cLockers, -1, 0))
    248248            return;
     
    250250        /* darn, someone raced in on us. */
    251251        Assert(pVCpu->hNativeThread);
    252         ASMAtomicXchgSize(&pCritSect->s.Core.NativeThreadOwner, pVCpu->hNativeThread);
     252        ASMAtomicWriteHandle(&pCritSect->s.Core.NativeThreadOwner, pVCpu->hNativeThread);
    253253        STAM_PROFILE_ADV_START(&pCritSect->s.StatLocked, l);
    254254    }
     
    324324
    325325/**
    326  * Checks if somebody currently owns the critical section. 
     326 * Checks if somebody currently owns the critical section.
    327327 * Note: This doesn't prove that no deadlocks will occur later on; it's just a debugging tool
    328328 *
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