v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
v8::platform::DefaultWorkerThreadsTaskRunner Class Reference

#include <default-worker-threads-task-runner.h>

Inheritance diagram for v8::platform::DefaultWorkerThreadsTaskRunner:
Collaboration diagram for v8::platform::DefaultWorkerThreadsTaskRunner:

Classes

class  WorkerThread
 

Public Types

using TimeFunction = double (*)()
 

Public Member Functions

 DefaultWorkerThreadsTaskRunner (uint32_t thread_pool_size, TimeFunction time_function, base::Thread::Priority priority=base::Thread::Priority::kDefault)
 
 ~DefaultWorkerThreadsTaskRunner () override
 
void Terminate ()
 
double MonotonicallyIncreasingTime ()
 
bool IdleTasksEnabled () override
 

Private Member Functions

void PostTaskImpl (std::unique_ptr< Task > task, const SourceLocation &location) override
 
void PostDelayedTaskImpl (std::unique_ptr< Task > task, double delay_in_seconds, const SourceLocation &location) override
 
void PostIdleTaskImpl (std::unique_ptr< IdleTask > task, const SourceLocation &location) override
 
std::unique_ptr< TaskGetNext ()
 

Private Attributes

bool terminated_ = false
 
base::Mutex lock_
 
std::vector< WorkerThread * > idle_threads_
 
std::vector< std::unique_ptr< WorkerThread > > thread_pool_
 
DelayedTaskQueue queue_
 
std::queue< std::unique_ptr< Task > > task_queue_
 
TimeFunction time_function_
 

Detailed Description

Definition at line 21 of file default-worker-threads-task-runner.h.

Member Typedef Documentation

◆ TimeFunction

Constructor & Destructor Documentation

◆ DefaultWorkerThreadsTaskRunner()

v8::platform::DefaultWorkerThreadsTaskRunner::DefaultWorkerThreadsTaskRunner ( uint32_t thread_pool_size,
TimeFunction time_function,
base::Thread::Priority priority = base::Thread::Priority::kDefault )

Definition at line 13 of file default-worker-threads-task-runner.cc.

◆ ~DefaultWorkerThreadsTaskRunner()

v8::platform::DefaultWorkerThreadsTaskRunner::~DefaultWorkerThreadsTaskRunner ( )
overridedefault

Member Function Documentation

◆ GetNext()

std::unique_ptr< Task > v8::platform::DefaultWorkerThreadsTaskRunner::GetNext ( )
private

◆ IdleTasksEnabled()

bool v8::platform::DefaultWorkerThreadsTaskRunner::IdleTasksEnabled ( )
override

Definition at line 70 of file default-worker-threads-task-runner.cc.

◆ MonotonicallyIncreasingTime()

double v8::platform::DefaultWorkerThreadsTaskRunner::MonotonicallyIncreasingTime ( )

Definition at line 24 of file default-worker-threads-task-runner.cc.

◆ PostDelayedTaskImpl()

void v8::platform::DefaultWorkerThreadsTaskRunner::PostDelayedTaskImpl ( std::unique_ptr< Task > task,
double delay_in_seconds,
const SourceLocation & location )
overrideprivate

Definition at line 51 of file default-worker-threads-task-runner.cc.

Here is the call graph for this function:

◆ PostIdleTaskImpl()

void v8::platform::DefaultWorkerThreadsTaskRunner::PostIdleTaskImpl ( std::unique_ptr< IdleTask > task,
const SourceLocation & location )
overrideprivate

Definition at line 64 of file default-worker-threads-task-runner.cc.

◆ PostTaskImpl()

void v8::platform::DefaultWorkerThreadsTaskRunner::PostTaskImpl ( std::unique_ptr< Task > task,
const SourceLocation & location )
overrideprivate

Definition at line 39 of file default-worker-threads-task-runner.cc.

Here is the call graph for this function:

◆ Terminate()

void v8::platform::DefaultWorkerThreadsTaskRunner::Terminate ( )

Definition at line 28 of file default-worker-threads-task-runner.cc.

Here is the call graph for this function:

Member Data Documentation

◆ idle_threads_

std::vector<WorkerThread*> v8::platform::DefaultWorkerThreadsTaskRunner::idle_threads_
private

Definition at line 77 of file default-worker-threads-task-runner.h.

◆ lock_

base::Mutex v8::platform::DefaultWorkerThreadsTaskRunner::lock_
private

Definition at line 74 of file default-worker-threads-task-runner.h.

◆ queue_

DelayedTaskQueue v8::platform::DefaultWorkerThreadsTaskRunner::queue_
private

Definition at line 81 of file default-worker-threads-task-runner.h.

◆ task_queue_

std::queue<std::unique_ptr<Task> > v8::platform::DefaultWorkerThreadsTaskRunner::task_queue_
private

Definition at line 82 of file default-worker-threads-task-runner.h.

◆ terminated_

bool v8::platform::DefaultWorkerThreadsTaskRunner::terminated_ = false
private

Definition at line 73 of file default-worker-threads-task-runner.h.

◆ thread_pool_

std::vector<std::unique_ptr<WorkerThread> > v8::platform::DefaultWorkerThreadsTaskRunner::thread_pool_
private

Definition at line 78 of file default-worker-threads-task-runner.h.

◆ time_function_

TimeFunction v8::platform::DefaultWorkerThreadsTaskRunner::time_function_
private

Definition at line 83 of file default-worker-threads-task-runner.h.


The documentation for this class was generated from the following files: