void OptimizingCompilerThread::Run() {
#ifdef DEBUG
- thread_id_ = ThreadId::Current().ToInteger();
+ { ScopedLock lock(thread_id_mutex_);
+ thread_id_ = ThreadId::Current().ToInteger();
+ }
#endif
Isolate::SetIsolateThreadLocals(isolate_, NULL);
DisallowHeapAllocation no_allocation;
#ifdef DEBUG
bool OptimizingCompilerThread::IsOptimizerThread() {
if (!FLAG_parallel_recompilation) return false;
+ ScopedLock lock(thread_id_mutex_);
return ThreadId::Current().ToInteger() == thread_id_;
}
#endif
Thread("OptimizingCompilerThread"),
#ifdef DEBUG
thread_id_(0),
+ thread_id_mutex_(OS::CreateMutex()),
#endif
isolate_(isolate),
stop_semaphore_(OS::CreateSemaphore(0)),
private:
#ifdef DEBUG
int thread_id_;
+ Mutex* thread_id_mutex_;
#endif
Isolate* isolate_;