Backed out changeset 072392a96295 (bug 1290240) for 10.10 debug cpp test failures CLOSED TREE

This commit is contained in:
Wes Kocher 2016-08-01 14:45:00 -07:00
parent e4da1cddc9
commit 1909229bf2
2 changed files with 8 additions and 8 deletions

View File

@ -3317,8 +3317,8 @@ GCHelperState::work()
AutoLockGC lock(rt);
MOZ_ASSERT(thread.isNothing());
thread = mozilla::Some(ThisThread::GetId());
MOZ_ASSERT(!thread);
thread = PR_GetCurrentThread();
TraceLoggerThread* logger = TraceLoggerForCurrentThread();
@ -3338,7 +3338,7 @@ GCHelperState::work()
}
setState(IDLE, lock);
thread.reset();
thread = nullptr;
done.notify_all();
}
@ -3419,7 +3419,7 @@ GCHelperState::doSweep(AutoLockGC& lock)
bool
GCHelperState::onBackgroundThread()
{
return thread.isSome() && *thread == ThisThread::GetId();
return PR_GetCurrentThread() == thread;
}
bool

View File

@ -20,7 +20,6 @@
#include "js/SliceBudget.h"
#include "js/Vector.h"
#include "threading/ConditionVariable.h"
#include "threading/Thread.h"
#include "vm/NativeObject.h"
namespace js {
@ -863,8 +862,8 @@ class GCHelperState
// Activity for the helper to do, protected by the GC lock.
State state_;
// Thread which work is being performed on, if any.
mozilla::Maybe<Thread::Id> thread;
// Thread which work is being performed on, or null.
PRThread* thread;
void startBackgroundThread(State newState, const AutoLockGC& lock,
const AutoLockHelperThreadState& helperLock);
@ -888,7 +887,8 @@ class GCHelperState
explicit GCHelperState(JSRuntime* rt)
: rt(rt),
done(),
state_(IDLE)
state_(IDLE),
thread(nullptr)
{ }
void finish();