Bug 489299 TestSynchronization.cpp failed to compile with Sun Studio r=benjamin, jones.chris.g

This commit is contained in:
Ginn Chen 2009-06-11 14:46:13 +08:00
Родитель b654c90a3c
Коммит 15183dceab
3 изменённых файлов: 12 добавлений и 7 удалений

Просмотреть файл

@ -152,6 +152,10 @@ ifeq ($(OS_ARCH)$(OS_RELEASE),FreeBSD2)
LIBS += -lpcap
endif
ifdef SOLARIS_SUNPRO_CXX
CXXFLAGS += -features=extensions -D__FUNCTION__=__func__
endif
ENABLE_CXX_EXCEPTIONS = 1
XPCSHELL_TESTS = unit

Просмотреть файл

@ -518,7 +518,8 @@ ContentionNoDeadlock_Child()
nsresult
ContentionNoDeadlock()
{
Subprocess proc(__FUNCTION__);
const char * func = __func__;
Subprocess proc(func);
proc.RunToCompletion(10000);
if (0 != proc.mExitCode) {
printf("(expected 0 == return code, got %d)\n", proc.mExitCode);

Просмотреть файл

@ -56,13 +56,13 @@
#ifdef OLD_API
# include "nsAutoLock.h"
typedef PRLock* lock_t;
typedef PRLock* moz_lock_t;
# define NEWLOCK(n) nsAutoLock::NewLock(n)
# define DELETELOCK(v) nsAutoLock::DestroyLock(v)
# define AUTOLOCK(v, l) nsAutoLock v(l)
#else
# include "mozilla/Mutex.h"
typedef mozilla::Mutex* lock_t;
typedef mozilla::Mutex* moz_lock_t;
# define NEWLOCK(n) new mozilla::Mutex(n)
# define DELETELOCK(v) delete (v)
# define AUTOLOCK(v, l) mozilla::MutexAutoLock v(*l)
@ -83,7 +83,7 @@ AllocLockRecurseUnlockFree(int i)
if (0 == i)
return;
lock_t lock = NEWLOCK("deadlockDetector.scalability.t1");
moz_lock_t lock = NEWLOCK("deadlockDetector.scalability.t1");
{
AUTOLOCK(_, lock);
AllocLockRecurseUnlockFree(i - 1);
@ -111,8 +111,8 @@ LengthNDepChain(int N)
static nsresult
OneLockNDeps(const int N, const int K)
{
lock_t lock = NEWLOCK("deadlockDetector.scalability.t2.master");
lock_t* locks = new lock_t[N];
moz_lock_t lock = NEWLOCK("deadlockDetector.scalability.t2.master");
moz_lock_t* locks = new moz_lock_t[N];
if (!locks)
NS_RUNTIMEABORT("couldn't allocate lock array");
@ -156,7 +156,7 @@ OneLockNDeps(const int N, const int K)
static nsresult
MaxDepsNsq(const int N, const int K)
{
lock_t* locks = new lock_t[N];
moz_lock_t* locks = new moz_lock_t[N];
if (!locks)
NS_RUNTIMEABORT("couldn't allocate lock array");