Index: src/optimizing-compiler-thread.cc |
diff --git a/src/optimizing-compiler-thread.cc b/src/optimizing-compiler-thread.cc |
index b9ff7d83eca369c0b194ab2cd40ccdec5c9379be..a38a0db9b08bc96ecca9fc6d0a3272e6e6a8648e 100644 |
--- a/src/optimizing-compiler-thread.cc |
+++ b/src/optimizing-compiler-thread.cc |
@@ -39,7 +39,9 @@ namespace internal { |
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; |
@@ -156,7 +158,8 @@ void OptimizingCompilerThread::QueueForOptimization( |
#ifdef DEBUG |
bool OptimizingCompilerThread::IsOptimizerThread() { |
if (!FLAG_parallel_recompilation) return false; |
- return ThreadId::Current().ToInteger() == thread_id_; |
+ ScopedLock lock(thread_id_mutex_); |
+ return ThreadId::Current().ToInteger() == thread_id_; |
Jakob Kummerow
2013/06/28 11:00:54
nit: duplicate space after 'return'
|
} |
#endif |