Changeset 101924 in vbox
- Timestamp:
- Nov 7, 2023 10:19:23 AM (15 months ago)
- Location:
- trunk/src/libs/xpcom18a4/ipc/ipcd/extensions/dconnect/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libs/xpcom18a4/ipc/ipcd/extensions/dconnect/src/ipcDConnectService.cpp
r93910 r101924 2400 2400 // mCachedISupports, but NSPR doesn't provide cross-platform cmpxchg 2401 2401 // functionality, so we have to use a shared lock instead... 2402 PR_Lock(dConnect->StubQILock());2402 RTSemFastMutexRequest(dConnect->StubQILock()); 2403 2403 2404 2404 // check if we have already got a nsISupports stub for this object … … 2408 2408 NS_ADDREF(mCachedISupports); 2409 2409 2410 PR_Unlock(dConnect->StubQILock());2410 RTSemFastMutexRelease(dConnect->StubQILock()); 2411 2411 return NS_OK; 2412 2412 } … … 2429 2429 mCachedISupports = this; 2430 2430 2431 PR_Unlock(dConnect->StubQILock());2431 RTSemFastMutexRelease(dConnect->StubQILock()); 2432 2432 return NS_OK; 2433 2433 } … … 2476 2476 } 2477 2477 2478 PR_Unlock(dConnect->StubQILock());2478 RTSemFastMutexRelease(dConnect->StubQILock()); 2479 2479 } 2480 2480 … … 3009 3009 3010 3010 ipcDConnectService::ipcDConnectService() 3011 : mLock(N ULL)3012 , mStubLock(N ULL)3011 : mLock(NIL_RTSEMFASTMUTEX) 3012 , mStubLock(NIL_RTSEMFASTMUTEX) 3013 3013 , mDisconnected(PR_TRUE) 3014 , mStubQILock(N ULL)3014 , mStubQILock(NIL_RTSEMFASTMUTEX) 3015 3015 #if defined(DCONNECT_WITH_IPRT_REQ_POOL) 3016 3016 , mhReqPool(NIL_RTREQPOOL) … … 3048 3048 3049 3049 mInstance = nsnull; 3050 PR_DestroyLock(mStubQILock); 3051 PR_DestroyLock(mStubLock); 3052 PR_DestroyLock(mLock); 3050 if (mStubQILock != NIL_RTSEMFASTMUTEX) 3051 RTSemFastMutexDestroy(mStubQILock); 3052 if (mStubLock != NIL_RTSEMFASTMUTEX) 3053 RTSemFastMutexDestroy(mStubLock); 3054 if (mLock != NIL_RTSEMFASTMUTEX) 3055 RTSemFastMutexDestroy(mLock); 3056 3053 3057 #if defined(DCONNECT_WITH_IPRT_REQ_POOL) 3054 3058 RTReqPoolRelease(mhReqPool); … … 3074 3078 return rv; 3075 3079 3076 mLock = PR_NewLock();3077 if ( !mLock)3080 int vrc = RTSemFastMutexCreate(&mLock); 3081 if (RT_FAILURE(vrc)) 3078 3082 return NS_ERROR_OUT_OF_MEMORY; 3079 3083 … … 3083 3087 return NS_ERROR_OUT_OF_MEMORY; 3084 3088 3085 mStubLock = PR_NewLock();3086 if ( !mStubLock)3089 vrc = RTSemFastMutexCreate(&mStubLock); 3090 if (RT_FAILURE(vrc)) 3087 3091 return NS_ERROR_OUT_OF_MEMORY; 3088 3092 … … 3094 3098 return rv; 3095 3099 3096 mStubQILock = PR_NewLock();3097 if ( !mStubQILock)3100 vrc = RTSemFastMutexCreate(&mStubQILock); 3101 if (RT_FAILURE(vrc)) 3098 3102 return NS_ERROR_OUT_OF_MEMORY; 3099 3103 … … 3332 3336 { 3333 3337 if (!locked) 3334 PR_Lock(mLock);3338 RTSemFastMutexRequest(mLock); 3335 3339 3336 3340 #ifdef IPC_LOGGING … … 3348 3352 3349 3353 if (!locked) 3350 PR_Unlock(mLock);3354 RTSemFastMutexRelease(mLock); 3351 3355 } 3352 3356 -
trunk/src/libs/xpcom18a4/ipc/ipcd/extensions/dconnect/src/ipcDConnectService.h
r52046 r101924 258 258 NS_HIDDEN_(PRBool) CheckInstanceAndAddRef(DConnectInstance *, PRUint32); 259 259 260 PRLock *StubLock() { return mStubLock; }261 PRLock *StubQILock() { return mStubQILock; }260 RTSEMFASTMUTEX StubLock() { return mStubLock; } 261 RTSEMFASTMUTEX StubQILock() { return mStubQILock; } 262 262 263 263 static nsRefPtr <ipcDConnectService> GetInstance() { … … 295 295 296 296 // lock to protect access to instance sets and the disconnected flag 297 PRLock *mLock;297 RTSEMFASTMUTEX mLock; 298 298 299 299 // table of local object instances allocated on behalf of a peer … … 306 306 // lock to protect access to mStubs and DConnectStub::mRefCntLevels 307 307 // (also guards every DConnectStub::Release call to provide atomicity) 308 PRLock *mStubLock;308 RTSEMFASTMUTEX mStubLock; 309 309 310 310 // table of remote object stubs allocated to communicate with peer's instances … … 324 324 // (we cannot use mStubLock because it isn't supposed to be held long, 325 325 // like in case of an IPC call and such) 326 PRLock *mStubQILock;326 RTSEMFASTMUTEX mStubQILock; 327 327 328 328 #if defined(DCONNECT_MULTITHREADED)
Note:
See TracChangeset
for help on using the changeset viewer.