Changeset 101905 in vbox
- Timestamp:
- Nov 6, 2023 9:08:40 PM (15 months ago)
- Location:
- trunk/src/libs/xpcom18a4
- Files:
-
- 2 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libs/xpcom18a4/Makefile.kmk
r101903 r101905 170 170 nsprpub/pr/include/prbit.h \ 171 171 nsprpub/pr/include/prclist.h \ 172 nsprpub/pr/include/prcmon.h \173 172 nsprpub/pr/include/prcvar.h \ 174 173 nsprpub/pr/include/prdtoa.h \ … … 500 499 nsprpub/pr/src/misc/prlong.c \ 501 500 nsprpub/pr/src/misc/prtime.c \ 502 nsprpub/pr/src/threads/prcmon.c \503 501 nsprpub/pr/src/threads/prtpd.c \ 504 502 nsprpub/lib/ds/plarena.c \ -
trunk/src/libs/xpcom18a4/nsprpub/pr/include/nspr.h
r101903 r101905 42 42 #include "prbit.h" 43 43 #include "prclist.h" 44 #include "prcmon.h"45 44 #include "prcvar.h" 46 45 #include "prdtoa.h" -
trunk/src/libs/xpcom18a4/nsprpub/pr/include/private/primpl.h
r101901 r101905 511 511 extern void _PR_InitMem(void); 512 512 extern void _PR_InitEnv(void); 513 extern void _PR_InitCMon(void);514 513 extern void _PR_InitIO(void); 515 514 extern void _PR_InitLog(void); -
trunk/src/libs/xpcom18a4/nsprpub/pr/src/misc/prinit.c
r101891 r101905 161 161 _PR_InitThreads(PR_USER_THREAD, PR_PRIORITY_NORMAL, 0); 162 162 163 _PR_InitCMon();164 163 _PR_InitIO(); 165 164 _PR_InitLog(); -
trunk/src/libs/xpcom18a4/xpcom/threads/nsAutoLock.cpp
r1 r101905 163 163 OrderTable = 0; 164 164 } 165 PR_CSetOnMonitorRecycle(OnMonitorRecycle);166 165 } 167 166 … … 172 171 173 172 // Called at shutdown, so we don't need to lock. 174 PR_CSetOnMonitorRecycle(0);175 173 PR_DestroyLock(OrderTableLock); 176 174 OrderTableLock = 0; … … 408 406 } 409 407 410 // XXX we don't worry about cached monitors being destroyed behind our back.411 // XXX current NSPR (mozilla/nsprpub/pr/src/threads/prcmon.c) never destroys412 // XXX a cached monitor! potential resource pig in conjunction with necko...413 414 void nsAutoCMonitor::Enter()415 {416 #ifdef DEBUG417 nsAutoLockBase* stackTop =418 (nsAutoLockBase*) PR_GetThreadPrivate(LockStackTPI);419 NS_ASSERTION(stackTop == mDown, "non-LIFO nsAutoCMonitor::Enter");420 mDown = stackTop;421 (void) PR_SetThreadPrivate(LockStackTPI, this);422 #endif423 PR_CEnterMonitor(mLockObject);424 mLockCount += 1;425 }426 427 void nsAutoCMonitor::Exit()428 {429 #ifdef DEBUG430 (void) PR_SetThreadPrivate(LockStackTPI, mDown);431 #endif432 PRStatus status = PR_CExitMonitor(mLockObject);433 NS_ASSERTION(status == PR_SUCCESS, "PR_CExitMonitor failed");434 mLockCount -= 1;435 } -
trunk/src/libs/xpcom18a4/xpcom/threads/nsAutoLock.h
r62330 r101905 211 211 }; 212 212 213 #include "pr cmon.h"213 #include "prmon.h" 214 214 #include "nsError.h" 215 215 #include "nsDebug.h" … … 317 317 }; 318 318 319 ////////////////////////////////////////////////////////////////////////////////320 // Once again, this time with a cache...321 // (Using this avoids the need to allocate a PRMonitor, which may be useful when322 // a large number of objects of the same class need associated monitors.)323 324 #include "prcmon.h"325 #include "nsError.h"326 327 class NS_COM nsAutoCMonitor : public nsAutoLockBase {328 public:329 nsAutoCMonitor(void* lockObject)330 : nsAutoLockBase(lockObject, eAutoCMonitor),331 mLockObject(lockObject), mLockCount(0)332 {333 NS_ASSERTION(lockObject, "null lock object");334 PR_CEnterMonitor(mLockObject);335 mLockCount = 1;336 }337 338 ~nsAutoCMonitor() {339 if (mLockCount) {340 #ifdef DEBUG341 PRStatus status =342 #endif343 PR_CExitMonitor(mLockObject);344 NS_ASSERTION(status == PR_SUCCESS, "PR_CExitMonitor failed");345 }346 }347 348 void Enter();349 void Exit();350 351 nsresult Wait(PRIntervalTime interval = PR_INTERVAL_NO_TIMEOUT) {352 return PR_CWait(mLockObject, interval) == PR_SUCCESS353 ? NS_OK : NS_ERROR_FAILURE;354 }355 356 nsresult Notify() {357 return PR_CNotify(mLockObject) == PR_SUCCESS358 ? NS_OK : NS_ERROR_FAILURE;359 }360 361 nsresult NotifyAll() {362 return PR_CNotifyAll(mLockObject) == PR_SUCCESS363 ? NS_OK : NS_ERROR_FAILURE;364 }365 366 private:367 void* mLockObject;368 PRInt32 mLockCount;369 370 // Not meant to be implemented. This makes it a compiler error to371 // construct or assign an nsAutoLock object incorrectly.372 nsAutoCMonitor(void);373 nsAutoCMonitor(const nsAutoCMonitor& /*aMon*/);374 nsAutoCMonitor& operator =(const nsAutoCMonitor& /*aMon*/);375 376 // Not meant to be implemented. This makes it a compiler error to377 // attempt to create an nsAutoLock object on the heap.378 static void* operator new(size_t /*size*/) CPP_THROW_NEW;379 static void operator delete(void* /*memory*/);380 };381 382 319 #endif // nsAutoLock_h__ 383 320
Note:
See TracChangeset
for help on using the changeset viewer.