LCOV - code coverage report
Current view: top level - src/libplatform - worker-thread.cc (source / functions) Hit Total Coverage
Test: app.info Lines: 11 11 100.0 %
Date: 2019-01-20 Functions: 4 4 100.0 %

          Line data    Source code
       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      429147 : WorkerThread::WorkerThread(TaskQueue* queue)
      14      429147 :     : Thread(Options("V8 WorkerThread")), queue_(queue) {
      15      429147 :   Start();
      16      429147 : }
      17             : 
      18             : 
      19      815846 : WorkerThread::~WorkerThread() {
      20      407923 :   Join();
      21      407923 : }
      22             : 
      23             : 
      24      428667 : void WorkerThread::Run() {
      25     3743051 :   while (std::unique_ptr<Task> task = queue_->GetNext()) {
      26     1453074 :     task->Run();
      27             :   }
      28      407915 : }
      29             : 
      30             : }  // namespace platform
      31             : }  // namespace v8

Generated by: LCOV version 1.10