LCOV - code coverage report
Current view: top level - src/libplatform - worker-thread.cc (source / functions) Hit Total Coverage
Test: app.info Lines: 12 12 100.0 %
Date: 2017-04-26 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      416280 : WorkerThread::WorkerThread(TaskQueue* queue)
      14      416280 :     : Thread(Options("V8 WorkerThread")), queue_(queue) {
      15      416280 :   Start();
      16      416280 : }
      17             : 
      18             : 
      19      822130 : WorkerThread::~WorkerThread() {
      20      411065 :   Join();
      21      411065 : }
      22             : 
      23             : 
      24      415824 : void WorkerThread::Run() {
      25     1048571 :   while (Task* task = queue_->GetNext()) {
      26      632584 :     task->Run();
      27      632709 :     delete task;
      28             :   }
      29      411061 : }
      30             : 
      31             : }  // namespace platform
      32             : }  // namespace v8

Generated by: LCOV version 1.10