mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 20:05:49 +00:00
Bug 1049051
- Part 5: Make sDeadlockDetector access internal. r=froydnj
--HG-- extra : rebase_source : ea7ee17679ca9d616c56376d7360852c37a19249
This commit is contained in:
parent
9e9c81074a
commit
939cad0587
@ -7,9 +7,12 @@
|
||||
#include "mozilla/BlockingResourceBase.h"
|
||||
|
||||
#ifdef DEBUG
|
||||
#include "prthread.h"
|
||||
|
||||
#include "nsAutoPtr.h"
|
||||
|
||||
#include "mozilla/CondVar.h"
|
||||
#include "mozilla/DeadlockDetector.h"
|
||||
#include "mozilla/ReentrantMonitor.h"
|
||||
#include "mozilla/Mutex.h"
|
||||
|
||||
@ -134,6 +137,34 @@ BlockingResourceBase::~BlockingResourceBase()
|
||||
}
|
||||
|
||||
|
||||
size_t
|
||||
BlockingResourceBase::SizeOfDeadlockDetector(MallocSizeOf aMallocSizeOf)
|
||||
{
|
||||
return sDeadlockDetector ?
|
||||
sDeadlockDetector->SizeOfIncludingThis(aMallocSizeOf) : 0;
|
||||
}
|
||||
|
||||
|
||||
PRStatus
|
||||
BlockingResourceBase::InitStatics()
|
||||
{
|
||||
PR_NewThreadPrivateIndex(&sResourceAcqnChainFrontTPI, 0);
|
||||
sDeadlockDetector = new DDT();
|
||||
if (!sDeadlockDetector) {
|
||||
NS_RUNTIMEABORT("can't allocate deadlock detector");
|
||||
}
|
||||
return PR_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
BlockingResourceBase::Shutdown()
|
||||
{
|
||||
delete sDeadlockDetector;
|
||||
sDeadlockDetector = 0;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
BlockingResourceBase::CheckAcquire()
|
||||
{
|
||||
|
@ -17,11 +17,8 @@
|
||||
|
||||
#ifdef DEBUG
|
||||
#include "prinit.h"
|
||||
#include "prthread.h"
|
||||
|
||||
#include "nsStringGlue.h"
|
||||
|
||||
#include "mozilla/DeadlockDetector.h"
|
||||
#include "nsXPCOM.h"
|
||||
#endif
|
||||
|
||||
@ -31,6 +28,9 @@
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
#ifdef DEBUG
|
||||
template <class T> class DeadlockDetector;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* BlockingResourceBase
|
||||
@ -53,11 +53,7 @@ public:
|
||||
#ifdef DEBUG
|
||||
|
||||
static size_t
|
||||
SizeOfDeadlockDetector(MallocSizeOf aMallocSizeOf)
|
||||
{
|
||||
return sDeadlockDetector ?
|
||||
sDeadlockDetector->SizeOfIncludingThis(aMallocSizeOf) : 0;
|
||||
}
|
||||
SizeOfDeadlockDetector(MallocSizeOf aMallocSizeOf);
|
||||
|
||||
/**
|
||||
* Print
|
||||
@ -260,15 +256,7 @@ private:
|
||||
*
|
||||
* *NOT* thread safe.
|
||||
*/
|
||||
static PRStatus InitStatics()
|
||||
{
|
||||
PR_NewThreadPrivateIndex(&sResourceAcqnChainFrontTPI, 0);
|
||||
sDeadlockDetector = new DDT();
|
||||
if (!sDeadlockDetector) {
|
||||
NS_RUNTIMEABORT("can't allocate deadlock detector");
|
||||
}
|
||||
return PR_SUCCESS;
|
||||
}
|
||||
static PRStatus InitStatics();
|
||||
|
||||
/**
|
||||
* Shutdown
|
||||
@ -276,11 +264,7 @@ private:
|
||||
*
|
||||
* *NOT* thread safe.
|
||||
*/
|
||||
static void Shutdown()
|
||||
{
|
||||
delete sDeadlockDetector;
|
||||
sDeadlockDetector = 0;
|
||||
}
|
||||
static void Shutdown();
|
||||
|
||||
# ifdef MOZILLA_INTERNAL_API
|
||||
// so it can call BlockingResourceBase::Shutdown()
|
||||
|
Loading…
Reference in New Issue
Block a user