Changeset 101966 in vbox
- Timestamp:
- Nov 8, 2023 12:30:30 PM (13 months ago)
- Location:
- trunk/src/libs/xpcom18a4/ipc/ipcd
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libs/xpcom18a4/ipc/ipcd/client/src/ipcdclient.cpp
r101915 r101966 57 57 #include "prio.h" 58 58 #include "prproces.h" 59 #include "pratom.h" 60 59 60 #include <iprt/asm.h> 61 61 #include <iprt/critsect.h> 62 62 … … 73 73 74 74 // threadsafe addref/release 75 NS_HIDDEN_(nsrefcnt) AddRef() { return PR_AtomicIncrement(&refcnt); }76 NS_HIDDEN_(nsrefcnt) Release() { PRInt32 r = PR_AtomicDecrement(&refcnt); if (r == 0) delete this; return r; }75 NS_HIDDEN_(nsrefcnt) AddRef() { return ASMAtomicIncU32(&refcnt); } 76 NS_HIDDEN_(nsrefcnt) Release() { uint32_t r = ASMAtomicDecU32(&refcnt); if (r == 0) delete this; return r; } 77 77 78 78 NS_HIDDEN_(void) SetObserver(ipcIMessageObserver *aObserver, PRBool aOnCurrentThread); … … 109 109 } 110 110 111 PRInt32refcnt;111 volatile uint32_t refcnt; 112 112 }; 113 113 -
trunk/src/libs/xpcom18a4/ipc/ipcd/extensions/dconnect/src/ipcDConnectService.cpp
r101927 r101966 55 55 # include <map> 56 56 # include <list> 57 # include <iprt/asm.h> 57 58 # include <iprt/err.h> 58 59 # include <iprt/req.h> … … 254 255 NS_PRECONDITION(PRInt32(mRefCnt) >= 0, "illegal refcnt"); 255 256 nsrefcnt count; 256 count = PR_AtomicIncrement((PRInt32*)&mRefCnt);257 count = ASMAtomicIncU32((volatile uint32_t *)&mRefCnt); 257 258 return count; 258 259 } … … 262 263 nsrefcnt count; 263 264 NS_PRECONDITION(0 != mRefCnt, "dup release"); 264 count = PR_AtomicDecrement((PRInt32*)&mRefCnt);265 count = ASMAtomicDecU32((volatile uint32_t *)&mRefCnt); 265 266 if (0 == count) { 266 267 NS_PRECONDITION(PRInt32(mRefCntIPC) == 0, "non-zero IPC refcnt"); … … 278 279 { 279 280 NS_PRECONDITION(PRInt32(mRefCntIPC) >= 0, "illegal refcnt"); 280 nsrefcnt count = PR_AtomicIncrement((PRInt32*)&mRefCntIPC);281 nsrefcnt count = ASMAtomicIncU32((volatile uint32_t *)&mRefCntIPC); 281 282 return count; 282 283 } … … 287 288 { 288 289 NS_PRECONDITION(0 != mRefCntIPC, "dup release"); 289 nsrefcnt count = PR_AtomicDecrement((PRInt32*)&mRefCntIPC);290 nsrefcnt count = ASMAtomicDecU32((volatile uint32_t *)&mRefCntIPC); 290 291 if (0 == count) { 291 292 // If the last IPC reference is released, remove this instance from the map. … … 1268 1269 NewRequestIndex() 1269 1270 { 1270 static PRInt32 sRequestIndex;1271 return (PRUint32) PR_AtomicIncrement(&sRequestIndex);1271 static volatile uint32_t sRequestIndex = 0; 1272 return ASMAtomicIncU32(&sRequestIndex); 1272 1273 } 1273 1274 … … 2255 2256 { 2256 2257 nsrefcnt count; 2257 count = PR_AtomicIncrement((PRInt32*)&mRefCnt);2258 count = ASMAtomicIncU32((volatile uint32_t *)&mRefCnt); 2258 2259 NS_LOG_ADDREF(this, count, "DConnectStub", sizeof(*this)); 2259 2260 return count; … … 2276 2277 nsAutoLock stubLock (dConnect->StubLock()); 2277 2278 2278 count = PR_AtomicDecrement((PRInt32*)&mRefCnt);2279 count = ASMAtomicDecU32((volatile uint32_t *)&mRefCnt); 2279 2280 NS_LOG_RELEASE(this, count, "DConnectStub"); 2280 2281 … … 2335 2336 else 2336 2337 { 2337 count = PR_AtomicDecrement((PRInt32*)&mRefCnt);2338 count = ASMAtomicDecU32((volatile uint32_t *)&mRefCnt); 2338 2339 NS_LOG_RELEASE(this, count, "DConnectStub"); 2339 2340 } -
trunk/src/libs/xpcom18a4/ipc/ipcd/shared/src/ipcm.cpp
r1 r101966 38 38 #include <string.h> 39 39 #include "ipcm.h" 40 #include "pratom.h" 40 41 #include <iprt/asm.h> 41 42 42 43 const nsID IPCM_TARGET = … … 51 52 IPCM_NewRequestIndex() 52 53 { 53 static PRInt32 sRequestIndex;54 return (PRUint32) PR_AtomicIncrement(&sRequestIndex);54 static volatile uint32_t sRequestIndex = 0; 55 return ASMAtomicIncU32(&sRequestIndex); 55 56 } 56 57
Note:
See TracChangeset
for help on using the changeset viewer.