v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
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
5
#include "
src/libplatform/worker-thread.h
"
6
7
#include "
include/v8-platform.h
"
8
#include "
src/libplatform/task-queue.h
"
9
10
namespace
v8
{
11
namespace
platform {
12
13
WorkerThread::WorkerThread
(
TaskQueue
* queue)
14
: Thread(Options(
"V8 WorkerThread"
)), queue_(queue) {
15
CHECK
(Start());
16
}
17
18
WorkerThread::~WorkerThread
() {
19
Join();
20
}
21
22
void
WorkerThread::Run
() {
23
while
(std::unique_ptr<Task> task =
queue_
->
GetNext
()) {
24
task->Run();
25
}
26
}
27
28
}
// namespace platform
29
}
// namespace v8
v8::platform::TaskQueue
Definition
task-queue.h:22
v8::platform::TaskQueue::GetNext
std::unique_ptr< Task > GetNext()
Definition
task-queue.cc:31
v8::platform::WorkerThread::Run
void Run() override
Definition
worker-thread.cc:22
v8::platform::WorkerThread::~WorkerThread
~WorkerThread() override
Definition
worker-thread.cc:18
v8::platform::WorkerThread::queue_
TaskQueue * queue_
Definition
worker-thread.h:32
v8::platform::WorkerThread::WorkerThread
WorkerThread(TaskQueue *queue)
Definition
worker-thread.cc:13
v8
Definition
api-arguments-inl.h:19
CHECK
#define CHECK(condition)
Definition
logging.h:124
task-queue.h
v8-platform.h
worker-thread.h
src
libplatform
worker-thread.cc
Generated on Sun Apr 6 2025 21:08:54 for v8 by
1.12.0