• 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   virtual ~WorkerThread();
25 
26   // Thread implementation.
27   void Run() override;
28 
29  private:
30   friend class QuitTask;
31 
32   TaskQueue* queue_;
33 
34   DISALLOW_COPY_AND_ASSIGN(WorkerThread);
35 };
36 
37 }  // namespace platform
38 }  // namespace v8
39 
40 
41 #endif  // V8_LIBPLATFORM_WORKER_THREAD_H_
42