diff --git a/storage/src/SQLiteMutex.h b/storage/src/SQLiteMutex.h index 0c1a68cefa5..a74f3c2dc9a 100644 --- a/storage/src/SQLiteMutex.h +++ b/storage/src/SQLiteMutex.h @@ -88,11 +88,10 @@ public: // While SQLite Mutexes may be recursive, in our own code we do not want to // treat them as such. - CallStack callContext = CallStack(); - CheckAcquire(callContext); + CheckAcquire(); sqlite3_mutex_enter(mMutex); - Acquire(callContext); // Call is protected by us holding the mutex. + Acquire(); // Call is protected by us holding the mutex. } void unlock() diff --git a/xpcom/glue/BlockingResourceBase.cpp b/xpcom/glue/BlockingResourceBase.cpp index 8742772f8eb..0a5c81dd968 100644 --- a/xpcom/glue/BlockingResourceBase.cpp +++ b/xpcom/glue/BlockingResourceBase.cpp @@ -89,7 +89,7 @@ BlockingResourceBase::~BlockingResourceBase() void -BlockingResourceBase::CheckAcquire(const CallStack& aCallContext) +BlockingResourceBase::CheckAcquire() { if (mDDEntry->mType == eCondVar) { NS_NOTYETIMPLEMENTED( @@ -100,7 +100,7 @@ BlockingResourceBase::CheckAcquire(const CallStack& aCallContext) BlockingResourceBase* chainFront = ResourceChainFront(); nsAutoPtr cycle( sDeadlockDetector->CheckAcquisition( - chainFront ? chainFront->mDDEntry : 0, mDDEntry, aCallContext)); + chainFront ? chainFront->mDDEntry : 0, mDDEntry)); if (!cycle) { return; } @@ -127,7 +127,7 @@ BlockingResourceBase::CheckAcquire(const CallStack& aCallContext) void -BlockingResourceBase::Acquire(const CallStack& aCallContext) +BlockingResourceBase::Acquire() { if (mDDEntry->mType == eCondVar) { NS_NOTYETIMPLEMENTED( @@ -219,11 +219,9 @@ BlockingResourceBase::PrintCycle(const DDT::ResourceAcquisitionArray* aCycle, void OffTheBooksMutex::Lock() { - CallStack callContext = CallStack(); - - CheckAcquire(callContext); + CheckAcquire(); PR_Lock(mLock); - Acquire(callContext); // protected by mLock + Acquire(); // protected by mLock } void @@ -251,8 +249,6 @@ ReentrantMonitor::Enter() return; } - CallStack callContext = CallStack(); - // this is sort of a hack around not recording the thread that // owns this monitor if (chainFront) { @@ -266,7 +262,7 @@ ReentrantMonitor::Enter() " [stack trace unavailable]\n"); // show the caller why this is potentially bad - CheckAcquire(callContext); + CheckAcquire(); PR_EnterMonitor(mReentrantMonitor); ++mEntryCount; @@ -275,10 +271,10 @@ ReentrantMonitor::Enter() } } - CheckAcquire(callContext); + CheckAcquire(); PR_EnterMonitor(mReentrantMonitor); NS_ASSERTION(mEntryCount == 0, "ReentrantMonitor isn't free!"); - Acquire(callContext); // protected by mReentrantMonitor + Acquire(); // protected by mReentrantMonitor mEntryCount = 1; } diff --git a/xpcom/glue/BlockingResourceBase.h b/xpcom/glue/BlockingResourceBase.h index 58b14a9b91f..4217f5f984b 100644 --- a/xpcom/glue/BlockingResourceBase.h +++ b/xpcom/glue/BlockingResourceBase.h @@ -155,21 +155,15 @@ protected: * CheckAcquire * * Thread safe. - * - * @param aCallContext the client's calling context from which the - * original acquisition request was made. **/ - void CheckAcquire(const CallStack& aCallContext); + void CheckAcquire(); /** * Acquire * * *NOT* thread safe. Requires ownership of underlying resource. - * - * @param aCallContext the client's calling context from which the - * original acquisition request was made. **/ - void Acquire(const CallStack& aCallContext); //NS_NEEDS_RESOURCE(this) + void Acquire(); //NS_NEEDS_RESOURCE(this) /** * Release diff --git a/xpcom/glue/DeadlockDetector.h b/xpcom/glue/DeadlockDetector.h index 652ae381ae9..b43b18cb652 100644 --- a/xpcom/glue/DeadlockDetector.h +++ b/xpcom/glue/DeadlockDetector.h @@ -298,7 +298,7 @@ public: /** * CheckAcquisition This method is called after acquiring |aLast|, - * but before trying to acquire |aProposed| from |aCallContext|. + * but before trying to acquire |aProposed|. * It determines whether actually trying to acquire |aProposed| * will create problems. It is OK if |aLast| is nullptr; this is * interpreted as |aProposed| being the thread's first acquisition @@ -316,11 +316,9 @@ public: * * @param aLast Last resource acquired by calling thread (or 0). * @param aProposed Resource calling thread proposes to acquire. - * @param aCallContext Calling context whence acquisiton request came. */ ResourceAcquisitionArray* CheckAcquisition(const T* aLast, - const T* aProposed, - const CallStack& aCallContext) + const T* aProposed) { if (!aLast) { // don't check if |0 < aProposed|; just vamoose