base::OS::MemoryMappedFile* Shell::counters_file_ = NULL;
CounterCollection Shell::local_counters_;
CounterCollection* Shell::counters_ = &local_counters_;
-base::Mutex Shell::context_mutex_;
+base::LazyMutex Shell::context_mutex_;
const base::TimeTicks Shell::kInitialTicks =
base::TimeTicks::HighResolutionNow();
Persistent<Context> Shell::utility_context_;
-base::Mutex Shell::workers_mutex_;
+base::LazyMutex Shell::workers_mutex_;
bool Shell::allow_new_workers_ = true;
i::List<Worker*> Shell::workers_;
i::List<SharedArrayBuffer::Contents> Shell::externalized_shared_contents_;
}
{
- base::LockGuard<base::Mutex> lock_guard(&workers_mutex_);
+ base::LockGuard<base::Mutex> lock_guard(workers_mutex_.Pointer());
if (!allow_new_workers_) return;
Worker* worker = new Worker;
Local<Context> Shell::CreateEvaluationContext(Isolate* isolate) {
#ifndef V8_SHARED
// This needs to be a critical section since this is not thread-safe
- base::LockGuard<base::Mutex> lock_guard(&context_mutex_);
+ base::LockGuard<base::Mutex> lock_guard(context_mutex_.Pointer());
#endif // !V8_SHARED
// Initialize the global objects
Handle<ObjectTemplate> global_template = CreateGlobalTemplate(isolate);
// create a new Worker, it would deadlock.
i::List<Worker*> workers_copy;
{
- base::LockGuard<base::Mutex> lock_guard(&workers_mutex_);
+ base::LockGuard<base::Mutex> lock_guard(workers_mutex_.Pointer());
allow_new_workers_ = false;
workers_copy.AddAll(workers_);
workers_.Clear();
// Now that all workers are terminated, we can re-enable Worker creation.
{
- base::LockGuard<base::Mutex> lock_guard(&workers_mutex_);
+ base::LockGuard<base::Mutex> lock_guard(workers_mutex_.Pointer());
allow_new_workers_ = true;
}
static CounterCollection local_counters_;
static CounterCollection* counters_;
static base::OS::MemoryMappedFile* counters_file_;
- static base::Mutex context_mutex_;
+ static base::LazyMutex context_mutex_;
static const base::TimeTicks kInitialTicks;
- static base::Mutex workers_mutex_;
+ static base::LazyMutex workers_mutex_;
static bool allow_new_workers_;
static i::List<Worker*> workers_;
static i::List<SharedArrayBuffer::Contents> externalized_shared_contents_;