Changeset 5522 in vbox for trunk/src/libs/xpcom18a4/xpcom/base
- Timestamp:
- Oct 26, 2007 5:21:00 PM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 25742
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libs/xpcom18a4/xpcom/base/nsExceptionService.cpp
r1 r5522 84 84 #ifdef NS_DEBUG 85 85 inline nsrefcnt ReleaseQuiet() { 86 nsAutoOwningThread old = _mOwningThread; 87 _mOwningThread = nsAutoOwningThread(); 88 nsrefcnt ref = Release(); 86 // shut up NS_ASSERT_OWNINGTHREAD (see explaination below) 87 nsAutoOwningThread old = _mOwningThread; 88 _mOwningThread = nsAutoOwningThread(); 89 nsrefcnt ref = Release(); 90 NS_ASSERTION(ref == 0, "the object is still referenced by other threads while it shouldn't"); 91 if (ref != 0) 89 92 _mOwningThread = old; 90 93 return ref; 91 94 } 92 95 #else … … 103 106 #endif 104 107 105 // Note this object is single threaded - the service itself ensures 106 // one per thread. 107 // Exceptions are DropAllThreads (called on the thread shutting down xpcom) 108 // and ThreadDestruct (called after xpcom destroyed the internal thread struct, 109 // so that PR_GetCurrentThread() will create a new one from scratch which will 110 // obviously not match the old one stored in the instance on creation). Since 111 // these NS_CheckThreadSafe() assertions are quite annoying in the debug build, 112 // we use a special ReleaseQuiet() mehtod in DoDropThread() to shut them up. 108 // Note: the nsExceptionManager object is single threaded - the exception 109 // service itself ensures one per thread. However, there are two methods that 110 // may be called on foreign threads: DropAllThreads (called on the thread 111 // shutting down xpcom) and ThreadDestruct (called after xpcom destroyed the 112 // internal thread struct, so that PR_GetCurrentThread() will create a new one 113 // from scratch which will obviously not match the old one stored in the 114 // instance on creation). In both cases, there should be no other threads 115 // holding objects (i.e. it's thread-safe to call them), but 116 // NS_CheckThreadSafe() assertions will still happen and yell in the debug 117 // build. Since it is quite annoying, we use a special ReleaseQuiet() mehtod 118 // in DoDropThread() to shut them up. 113 119 NS_IMPL_ISUPPORTS1(nsExceptionManager, nsIExceptionManager) 114 120
Note:
See TracChangeset
for help on using the changeset viewer.