V8 Project
v8::platform::WorkerThread Class Reference

#include <worker-thread.h>

+ Inheritance diagram for v8::platform::WorkerThread:
+ Collaboration diagram for v8::platform::WorkerThread:

Public Member Functions

 WorkerThread (TaskQueue *queue)
 
virtual ~WorkerThread ()
 
virtual void Run () OVERRIDE
 
- Public Member Functions inherited from v8::base::Thread
 Thread (const Options &options)
 
virtual ~Thread ()
 
void Start ()
 
void StartSynchronously ()
 
void Join ()
 
const char * name () const
 
PlatformDatadata ()
 
void NotifyStartedAndRun ()
 

Private Member Functions

 DISALLOW_COPY_AND_ASSIGN (WorkerThread)
 

Private Attributes

TaskQueuequeue_
 

Friends

class QuitTask
 

Additional Inherited Members

- Public Types inherited from v8::base::Thread
typedef int32_t LocalStorageKey
 
- Static Public Member Functions inherited from v8::base::Thread
static LocalStorageKey CreateThreadLocalKey ()
 
static void DeleteThreadLocalKey (LocalStorageKey key)
 
static void * GetThreadLocal (LocalStorageKey key)
 
static int GetThreadLocalInt (LocalStorageKey key)
 
static void SetThreadLocal (LocalStorageKey key, void *value)
 
static void SetThreadLocalInt (LocalStorageKey key, int value)
 
static bool HasThreadLocal (LocalStorageKey key)
 
static void * GetExistingThreadLocal (LocalStorageKey key)
 
static void YieldCPU ()
 
- Static Public Attributes inherited from v8::base::Thread
static const int kMaxThreadNameLength = 16
 

Detailed Description

Definition at line 19 of file worker-thread.h.

Constructor & Destructor Documentation

◆ WorkerThread()

v8::platform::WorkerThread::WorkerThread ( TaskQueue queue)
explicit

Definition at line 13 of file worker-thread.cc.

14  : Thread(Options("V8 WorkerThread")), queue_(queue) {
15  Start();
16 }
Thread(const Options &options)

References v8::base::Thread::Start().

+ Here is the call graph for this function:

◆ ~WorkerThread()

v8::platform::WorkerThread::~WorkerThread ( )
virtual

Definition at line 19 of file worker-thread.cc.

19  {
20  Join();
21 }

References v8::base::Thread::Join().

+ Here is the call graph for this function:

Member Function Documentation

◆ DISALLOW_COPY_AND_ASSIGN()

v8::platform::WorkerThread::DISALLOW_COPY_AND_ASSIGN ( WorkerThread  )
private

◆ Run()

void v8::platform::WorkerThread::Run ( )
virtual

Implements v8::base::Thread.

Definition at line 24 of file worker-thread.cc.

24  {
25  while (Task* task = queue_->GetNext()) {
26  task->Run();
27  delete task;
28  }
29 }

References v8::platform::TaskQueue::GetNext(), and queue_.

+ Here is the call graph for this function:

Friends And Related Function Documentation

◆ QuitTask

friend class QuitTask
friend

Definition at line 28 of file worker-thread.h.

Member Data Documentation

◆ queue_

TaskQueue* v8::platform::WorkerThread::queue_
private

Definition at line 30 of file worker-thread.h.

Referenced by Run().


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