Changeset 101978 in vbox
- Timestamp:
- Nov 8, 2023 1:44:31 PM (15 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libs/xpcom18a4/xpcom/io/nsNativeCharsetUtils.cpp
r46043 r101978 50 50 #include <locale.h> // setlocale 51 51 #include "nscore.h" 52 #include "prlock.h"53 52 #include "nsAString.h" 54 53 #include "nsReadableUtils.h" 54 55 #include <iprt/assert.h> 56 #include <iprt/errcore.h> 57 #include <iprt/semaphore.h> 55 58 56 59 // … … 271 274 static iconv_t gUTF8ToUnicode; 272 275 #endif 273 static PRLock *gLock;276 static RTSEMFASTMUTEX gLock; 274 277 static PRBool gInitialized; 275 278 276 279 static void LazyInit(); 277 280 278 static void Lock() { if (gLock ) PR_Lock(gLock);}279 static void Unlock() { if (gLock ) PR_Unlock(gLock); }281 static void Lock() { if (gLock != NILRTSEMFASTMUTEX) RTSemFastMutexRequest(gLock); } 282 static void Unlock() { if (gLock != NILRTSEMFASTMUTEX) RTSemFastMutexRelease(gLock); } 280 283 }; 281 284 … … 288 291 iconv_t nsNativeCharsetConverter::gUTF8ToUnicode = INVALID_ICONV_T; 289 292 #endif 290 PRLock *nsNativeCharsetConverter::gLock = nsnull;293 RTSEMFASTMUTEX nsNativeCharsetConverter::gLock = NIL_RTSEMFASTMUTEX; 291 294 PRBool nsNativeCharsetConverter::gInitialized = PR_FALSE; 292 295 … … 364 367 nsNativeCharsetConverter::GlobalInit() 365 368 { 366 gLock = PR_NewLock();367 NS_ASSERTION( gLock, "lock creation failed");369 int vrc = RTSemFastMutexCreate(&gLock); 370 NS_ASSERTION(RT_SUCCESS(vrc), "lock creation failed"); 368 371 } 369 372 … … 371 374 nsNativeCharsetConverter::GlobalShutdown() 372 375 { 373 if (gLock ) {374 PR_DestroyLock(gLock);375 gLock = nsnull;376 if (gLock != NIL_RTSEMFASTMUTEX) { 377 RTSemFastMutexDestroy(gLock); 378 gLock = NIL_RTSEMFASTMUTEX; 376 379 } 377 380 … … 1279 1282 1280 1283 #endif 1284
Note:
See TracChangeset
for help on using the changeset viewer.