VirtualBox

Changeset 6742 in vbox for trunk/src/VBox/Runtime/r3


Ignore:
Timestamp:
Feb 2, 2008 12:30:13 AM (17 years ago)
Author:
vboxsync
Message:

Use ASMAtomicCmpXchgS32

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/linux/semmutex-linux.cpp

    r6738 r6742  
    201201     * Lock the mutex.
    202202     */
    203     int32_t iOld;
    204     ASMAtomicCmpXchgExS32(&pIntMutexSem->iState, 1, 0, &iOld);
    205     if (RT_UNLIKELY(iOld != 0))
     203    if (RT_UNLIKELY(!ASMAtomicCmpXchgS32(&pIntMutexSem->iState, 1, 0)))
    206204    {
    207205        for (;;)
    208206        {
    209             iOld = ASMAtomicXchgS32(&pIntMutexSem->iState, 2);
     207            int32_t iOld = ASMAtomicXchgS32(&pIntMutexSem->iState, 2);
    210208
    211209            /*
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