V8 Project
worker-thread.cc
Go to the documentation of this file.
1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
6 
7 #include "include/v8-platform.h"
9 
10 namespace v8 {
11 namespace platform {
12 
14  : Thread(Options("V8 WorkerThread")), queue_(queue) {
15  Start();
16 }
17 
18 
20  Join();
21 }
22 
23 
25  while (Task* task = queue_->GetNext()) {
26  task->Run();
27  delete task;
28  }
29 }
30 
31 } } // namespace v8::platform
A Task represents a unit of work.
Definition: v8-platform.h:15
WorkerThread(TaskQueue *queue)
virtual void Run() OVERRIDE
Debugger support for the V8 JavaScript engine.
Definition: accessors.cc:20