• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #ifndef V8_LIBPLATFORM_WORKER_THREAD_H_
6 #define V8_LIBPLATFORM_WORKER_THREAD_H_
7 
8 #include <queue>
9 
10 #include "include/libplatform/libplatform-export.h"
11 #include "src/base/compiler-specific.h"
12 #include "src/base/macros.h"
13 #include "src/base/platform/platform.h"
14 
15 namespace v8 {
16 
17 namespace platform {
18 
19 class TaskQueue;
20 
NON_EXPORTED_BASE(base::Thread)21 class V8_PLATFORM_EXPORT WorkerThread : public NON_EXPORTED_BASE(base::Thread) {
22  public:
23   explicit WorkerThread(TaskQueue* queue);
24   ~WorkerThread() override;
25 
26   WorkerThread(const WorkerThread&) = delete;
27   WorkerThread& operator=(const WorkerThread&) = delete;
28 
29   // Thread implementation.
30   void Run() override;
31 
32  private:
33   TaskQueue* queue_;
34 };
35 
36 }  // namespace platform
37 }  // namespace v8
38 
39 
40 #endif  // V8_LIBPLATFORM_WORKER_THREAD_H_
41