VirtualBox

Ignore:
Timestamp:
Nov 8, 2023 12:30:30 PM (18 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
160063
Message:

libs/xpcom/ipc: Convert PR_Atomic* to ASMAtomic*, bugref:10545

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/ipc/ipcd/extensions/dconnect/src/ipcDConnectService.cpp

    r101927 r101966  
    5555# include <map>
    5656# include <list>
     57# include <iprt/asm.h>
    5758# include <iprt/err.h>
    5859# include <iprt/req.h>
     
    254255    NS_PRECONDITION(PRInt32(mRefCnt) >= 0, "illegal refcnt");
    255256    nsrefcnt count;
    256     count = PR_AtomicIncrement((PRInt32*)&mRefCnt);
     257    count = ASMAtomicIncU32((volatile uint32_t *)&mRefCnt);
    257258    return count;
    258259  }
     
    262263    nsrefcnt count;
    263264    NS_PRECONDITION(0 != mRefCnt, "dup release");
    264     count = PR_AtomicDecrement((PRInt32 *)&mRefCnt);
     265    count = ASMAtomicDecU32((volatile uint32_t *)&mRefCnt);
    265266    if (0 == count) {
    266267      NS_PRECONDITION(PRInt32(mRefCntIPC) == 0, "non-zero IPC refcnt");
     
    278279  {
    279280    NS_PRECONDITION(PRInt32(mRefCntIPC) >= 0, "illegal refcnt");
    280     nsrefcnt count = PR_AtomicIncrement((PRInt32*)&mRefCntIPC);
     281    nsrefcnt count = ASMAtomicIncU32((volatile uint32_t *)&mRefCntIPC);
    281282    return count;
    282283  }
     
    287288  {
    288289    NS_PRECONDITION(0 != mRefCntIPC, "dup release");
    289     nsrefcnt count = PR_AtomicDecrement((PRInt32 *)&mRefCntIPC);
     290    nsrefcnt count = ASMAtomicDecU32((volatile uint32_t *)&mRefCntIPC);
    290291    if (0 == count) {
    291292      // If the last IPC reference is released, remove this instance from the map.
     
    12681269NewRequestIndex()
    12691270{
    1270   static PRInt32 sRequestIndex;
    1271   return (PRUint32) PR_AtomicIncrement(&sRequestIndex);
     1271  static volatile uint32_t sRequestIndex = 0;
     1272  return ASMAtomicIncU32(&sRequestIndex);
    12721273}
    12731274
     
    22552256{
    22562257  nsrefcnt count;
    2257   count = PR_AtomicIncrement((PRInt32*)&mRefCnt);
     2258  count = ASMAtomicIncU32((volatile uint32_t *)&mRefCnt);
    22582259  NS_LOG_ADDREF(this, count, "DConnectStub", sizeof(*this));
    22592260  return count;
     
    22762277    nsAutoLock stubLock (dConnect->StubLock());
    22772278
    2278     count = PR_AtomicDecrement((PRInt32 *)&mRefCnt);
     2279    count = ASMAtomicDecU32((volatile uint32_t *)&mRefCnt);
    22792280    NS_LOG_RELEASE(this, count, "DConnectStub");
    22802281
     
    23352336  else
    23362337  {
    2337     count = PR_AtomicDecrement((PRInt32 *)&mRefCnt);
     2338    count = ASMAtomicDecU32((volatile uint32_t *)&mRefCnt);
    23382339    NS_LOG_RELEASE(this, count, "DConnectStub");
    23392340  }
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