VirtualBox

Changeset 33196 in vbox for trunk/include


Ignore:
Timestamp:
Oct 18, 2010 2:03:32 PM (14 years ago)
Author:
vboxsync
Message:

iprt/asm: make the behavior of ASMAtomicAddU64() match the description (return the old value, not the new value, only 32-bit code affected)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/asm.h

    r33138 r33196  
    24962496    return u64;
    24972497# else
    2498     uint64_t u64New;
     2498    uint64_t u64Old;
    24992499    for (;;)
    25002500    {
    2501         uint64_t u64Old = ASMAtomicUoReadU64(pu64);
    2502         u64New = u64Old + u64;
     2501        u64Old = ASMAtomicUoReadU64(pu64);
     2502        uint64_t u64New = u64Old + u64;
    25032503        if (ASMAtomicCmpXchgU64(pu64, u64New, u64Old))
    25042504            break;
    25052505        ASMNopPause();
    25062506    }
    2507     return u64New;
     2507    return u64Old;
    25082508# endif
    25092509}
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