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-04-18 Functions: 3 4 75.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           4 : WorkerThread::WorkerThread(TaskQueue* queue)
      14           4 :     : Thread(Options("V8 WorkerThread")), queue_(queue) {
      15           4 :   Start();
      16           4 : }
      17             : 
      18           8 : WorkerThread::~WorkerThread() {
      19           4 :   Join();
      20           4 : }
      21             : 
      22           4 : void WorkerThread::Run() {
      23          30 :   while (std::unique_ptr<Task> task = queue_->GetNext()) {
      24          11 :     task->Run();
      25             :   }
      26           4 : }
      27             : 
      28             : }  // namespace platform
      29             : }  // namespace v8

Generated by: LCOV version 1.10