Changeset 101967 in vbox for trunk/src/libs/xpcom18a4
- Timestamp:
- Nov 8, 2023 12:44:46 PM (15 months ago)
- Location:
- trunk/src/libs/xpcom18a4/xpcom
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libs/xpcom18a4/xpcom/glue/nsISupportsImpl.h
r65406 r101967 47 47 48 48 #include "prthread.h" /* needed for thread-safety checks */ 49 #include "pratom.h" /* needed for PR_AtomicIncrement and PR_AtomicDecrement */50 49 51 50 #include "nsDebug.h" … … 740 739 NS_PRECONDITION(PRInt32(mRefCnt) >= 0, "illegal refcnt"); \ 741 740 nsrefcnt count; \ 742 count = PR_AtomicIncrement((PRInt32*)&mRefCnt);\741 count = ASMAtomicIncU32((volatile uint32_t *)&mRefCnt); \ 743 742 NS_LOG_ADDREF(this, count, #_class, sizeof(*this)); \ 744 743 return count; \ … … 793 792 nsrefcnt count; \ 794 793 NS_PRECONDITION(0 != mRefCnt, "dup release"); \ 795 count = PR_AtomicDecrement((PRInt32 *)&mRefCnt);\794 count = ASMAtomicDecI32((volatile uint32_t *)&mRefCnt); \ 796 795 NS_LOG_RELEASE(this, count, #_class); \ 797 796 if (0 == count) { \ -
trunk/src/libs/xpcom18a4/xpcom/proxy/public/nsProxyEvent.h
r1 r101967 167 167 PRUint32 mParameterCount; /* number of params */ 168 168 PLEvent *mEvent; /* the current plevent */ 169 PRInt32mCompleted; /* is true when the method has been called. */169 volatile bool mCompleted; /* is true when the method has been called. */ 170 170 171 171 nsCOMPtr<nsIEventQueue> mCallersEventQ; /* this is the eventQ that we must post a message back to -
trunk/src/libs/xpcom18a4/xpcom/proxy/public/nsProxyRelease.h
r50361 r101967 40 40 41 41 #include "nsIEventQueueService.h" 42 #include "pratom.h"43 42 #include "prmem.h" 44 43 … … 64 63 { \ 65 64 NS_PRECONDITION(0 != mRefCnt, "dup release"); \ 66 nsrefcnt count = PR_AtomicDecrement((PRInt32 *)&mRefCnt);\65 nsrefcnt count = ASMAtomicDecU32((volatile uint32_t *)&mRefCnt); \ 67 66 NS_LOG_RELEASE(this, count, #_class); \ 68 67 \ -
trunk/src/libs/xpcom18a4/xpcom/proxy/src/nsProxyEvent.cpp
r101847 r101967 54 54 #include "nsCRT.h" 55 55 56 #include "pratom.h"57 56 #include "prmem.h" 58 57 #include "xptcall.h" … … 94 93 NS_ASSERTION(event, "No PLEvent!"); 95 94 96 mCompleted = 0;95 mCompleted = false; 97 96 mMethodIndex = methodIndex; 98 97 mParameterList = parameterList; … … 232 231 nsProxyObjectCallInfo::GetCompleted() 233 232 { 234 return (PRBool)mCompleted;233 return ASMAtomicReadBool(&mCompleted) ? PR_TRUE : PR_FALSE; 235 234 } 236 235 … … 238 237 nsProxyObjectCallInfo::SetCompleted() 239 238 { 240 PR_AtomicSet(&mCompleted, 1);239 ASMAtomicWriteBool(&mCompleted, true); 241 240 } 242 241 … … 311 310 nsProxyObject::AddRef() 312 311 { 313 PR_AtomicIncrement((PRInt32*)&mRefCnt);312 ASMAtomicIncU32((volatile uint32_t *)&mRefCnt); 314 313 NS_LOG_ADDREF(this, mRefCnt, "nsProxyObject", sizeof(*this)); 315 314 } … … 320 319 NS_PRECONDITION(0 != mRefCnt, "dup release"); 321 320 322 nsrefcnt count = PR_AtomicDecrement((PRInt32*)&mRefCnt);321 nsrefcnt count = ASMAtomicDecU32((volatile uint32_t *)&mRefCnt); 323 322 NS_LOG_RELEASE(this, count, "nsProxyObject"); 324 323 -
trunk/src/libs/xpcom18a4/xpcom/proxy/src/nsProxyEventObject.cpp
r1 r101967 488 488 // Decrement atomically - in case the Proxy Object Manager has already 489 489 // been deleted and the monitor is unavailable... 490 count = PR_AtomicDecrement((PRInt32*)&mRefCnt);490 count = ASMAtomicDecU32((volatile uint32_t *)&mRefCnt); 491 491 NS_LOG_RELEASE(this, count, "nsProxyEventObject"); 492 492 if (0 == count) { -
trunk/src/libs/xpcom18a4/xpcom/reflect/xptinfo/src/xptiInterfaceInfo.cpp
r101914 r101967 775 775 xptiInterfaceInfo::AddRef(void) 776 776 { 777 nsrefcnt cnt = (nsrefcnt) PR_AtomicIncrement((PRInt32*)&mRefCnt);777 nsrefcnt cnt = (nsrefcnt) ASMAtomicIncU32((volatile uint32_t *)&mRefCnt); 778 778 NS_LOG_ADDREF(this, cnt, "xptiInterfaceInfo", sizeof(*this)); 779 779 return cnt; … … 784 784 { 785 785 xptiInterfaceEntry* entry = mEntry; 786 nsrefcnt cnt = (nsrefcnt) PR_AtomicDecrement((PRInt32*)&mRefCnt);786 nsrefcnt cnt = (nsrefcnt) ASMAtomicDecU32((volatile uint32_t *)&mRefCnt); 787 787 NS_LOG_RELEASE(this, cnt, "xptiInterfaceInfo"); 788 788 if(!cnt) -
trunk/src/libs/xpcom18a4/xpcom/string/src/nsSubstring.cpp
r31259 r101967 50 50 #include "nsDependentString.h" 51 51 #include "nsMemory.h" 52 #i nclude "pratom.h"53 # ifdef VBOX_USE_IPRT_IN_XPCOM52 #ifdef VBOX_USE_IPRT_IN_XPCOM 53 # include <iprt/asm.h> 54 54 # include <iprt/mem.h> 55 55 #endif … … 98 98 } 99 99 100 PRInt32mAllocCount;101 PRInt32mReallocCount;102 PRInt32mFreeCount;103 PRInt32mShareCount;104 PRInt32mAdoptCount;105 PRInt32mAdoptFreeCount;100 volatile uint32_t mAllocCount; 101 volatile uint32_t mReallocCount; 102 volatile uint32_t mFreeCount; 103 volatile uint32_t mShareCount; 104 volatile uint32_t mAdoptCount; 105 volatile uint32_t mAdoptFreeCount; 106 106 }; 107 107 static nsStringStats gStringStats; 108 #define STRING_STAT_INCREMENT(_s) PR_AtomicIncrement(&gStringStats.m ## _s ## Count)108 #define STRING_STAT_INCREMENT(_s) ASMAtomicIncU32(&gStringStats.m ## _s ## Count) 109 109 #else 110 110 #define STRING_STAT_INCREMENT(_s) … … 126 126 private: 127 127 128 PRInt32mRefCount;128 volatile uint32_t mRefCount; 129 129 PRUint32 mStorageSize; 130 130 … … 133 133 void AddRef() 134 134 { 135 PR_AtomicIncrement(&mRefCount);135 ASMAtomicIncU32(&mRefCount); 136 136 STRING_STAT_INCREMENT(Share); 137 137 } … … 139 139 void Release() 140 140 { 141 if ( PR_AtomicDecrement(&mRefCount) == 0)141 if (ASMAtomicDecU32(&mRefCount) == 0) 142 142 { 143 143 STRING_STAT_INCREMENT(Free); -
trunk/src/libs/xpcom18a4/xpcom/threads/nsThread.h
r101960 r101967 54 54 #include "nsCOMPtr.h" 55 55 56 #include "prlock.h" 57 56 58 #include <iprt/thread.h> 57 59
Note:
See TracChangeset
for help on using the changeset viewer.