VirtualBox

Changeset 20008 in vbox for trunk/src/VBox/Runtime/generic


Ignore:
Timestamp:
May 25, 2009 6:34:43 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
47728
Message:

PDMCritSect: rewrite, ring-0 unlocking not yet enabled.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/generic/critsect-generic.cpp

    r19989 r20008  
    251251     */
    252252    pCritSect->cNestings = 1;
    253     ASMAtomicXchgSize(&pCritSect->NativeThreadOwner, NativeThreadSelf);
     253    ASMAtomicWriteHandle(&pCritSect->NativeThreadOwner, NativeThreadSelf);
    254254#ifdef RTCRITSECT_STRICT
    255255    pCritSect->Strict.pszEnterFile = pszFile;
    256256    pCritSect->Strict.u32EnterLine = uLine;
    257257    pCritSect->Strict.uEnterId     = uId;
    258     ASMAtomicXchgSize(&pCritSect->Strict.ThreadOwner, (RTUINTPTR)ThreadSelf); /* screw gcc and its pedantic warnings. */
     258    ASMAtomicWriteHandle(&pCritSect->Strict.ThreadOwner, ThreadSelf);
    259259#endif
    260260
     
    319319        {
    320320#ifdef RTCRITSECT_STRICT
    321             rtThreadBlocking(ThreadSelf, RTTHREADSTATE_CRITSECT, (uintptr_t)pCritSect, pszFile, uLine, uId);
     321            RTThreadBlocking(ThreadSelf, RTTHREADSTATE_CRITSECT, (uintptr_t)pCritSect, pszFile, uLine, uId);
    322322#endif
    323323            int rc = RTSemEventWait(pCritSect->EventSem, RT_INDEFINITE_WAIT);
    324324#ifdef RTCRITSECT_STRICT
    325             rtThreadUnblocked(ThreadSelf, RTTHREADSTATE_CRITSECT);
     325            RTThreadUnblocked(ThreadSelf, RTTHREADSTATE_CRITSECT);
    326326#endif
    327327            if (pCritSect->u32Magic != RTCRITSECT_MAGIC)
     
    338338     */
    339339    pCritSect->cNestings = 1;
    340     ASMAtomicXchgSize(&pCritSect->NativeThreadOwner, NativeThreadSelf);
     340    ASMAtomicWriteHandle(&pCritSect->NativeThreadOwner, NativeThreadSelf);
    341341#ifdef RTCRITSECT_STRICT
    342342    pCritSect->Strict.pszEnterFile = pszFile;
    343343    pCritSect->Strict.u32EnterLine = uLine;
    344344    pCritSect->Strict.uEnterId     = uId;
    345     ASMAtomicXchgSize(&pCritSect->Strict.ThreadOwner, (RTUINTPTR)ThreadSelf); /* screw gcc and its pedantic warnings. */
     345    ASMAtomicWriteHandle(&pCritSect->Strict.ThreadOwner, ThreadSelf);
    346346    RTThreadWriteLockInc(ThreadSelf);
    347347#endif
     
    383383        if (pCritSect->Strict.ThreadOwner != NIL_RTTHREAD) /* May happen for PDMCritSects when entering GC/R0. */
    384384            RTThreadWriteLockDec(pCritSect->Strict.ThreadOwner);
    385         ASMAtomicXchgSize(&pCritSect->Strict.ThreadOwner, NIL_RTTHREAD);
    386 #endif
    387         ASMAtomicXchgSize(&pCritSect->NativeThreadOwner, NIL_RTNATIVETHREAD);
     385        ASMAtomicWriteHandle(&pCritSect->Strict.ThreadOwner, NIL_RTTHREAD);
     386#endif
     387        ASMAtomicWriteHandle(&pCritSect->NativeThreadOwner, NIL_RTNATIVETHREAD);
    388388        if (ASMAtomicDecS32(&pCritSect->cLockers) >= 0)
    389389        {
Note: See TracChangeset for help on using the changeset viewer.

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