OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 12 matching lines...) Expand all Loading... |
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | 27 |
28 #ifndef V8_LIBPLATFORM_WORKER_THREAD_H_ | 28 #ifndef V8_LIBPLATFORM_WORKER_THREAD_H_ |
29 #define V8_LIBPLATFORM_WORKER_THREAD_H_ | 29 #define V8_LIBPLATFORM_WORKER_THREAD_H_ |
30 | 30 |
31 #include <queue> | 31 #include <queue> |
32 | 32 |
33 // TODO(jochen): We should have our own version of globals.h. | 33 #include "../base/macros.h" |
34 #include "../globals.h" | |
35 #include "../platform.h" | 34 #include "../platform.h" |
36 | 35 |
37 namespace v8 { | 36 namespace v8 { |
38 | 37 |
39 namespace internal { | 38 namespace internal { |
40 | 39 |
41 class TaskQueue; | 40 class TaskQueue; |
42 | 41 |
43 class WorkerThread : public Thread { | 42 class WorkerThread : public Thread { |
44 public: | 43 public: |
45 explicit WorkerThread(TaskQueue* queue); | 44 explicit WorkerThread(TaskQueue* queue); |
46 virtual ~WorkerThread(); | 45 virtual ~WorkerThread(); |
47 | 46 |
48 // Thread implementation. | 47 // Thread implementation. |
49 virtual void Run() V8_OVERRIDE; | 48 virtual void Run() V8_OVERRIDE; |
50 | 49 |
51 private: | 50 private: |
52 friend class QuitTask; | 51 friend class QuitTask; |
53 | 52 |
54 TaskQueue* queue_; | 53 TaskQueue* queue_; |
55 | 54 |
56 DISALLOW_COPY_AND_ASSIGN(WorkerThread); | 55 DISALLOW_COPY_AND_ASSIGN(WorkerThread); |
57 }; | 56 }; |
58 | 57 |
59 } } // namespace v8::internal | 58 } } // namespace v8::internal |
60 | 59 |
61 | 60 |
62 #endif // V8_LIBPLATFORM_WORKER_THREAD_H_ | 61 #endif // V8_LIBPLATFORM_WORKER_THREAD_H_ |
OLD | NEW |