OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #ifndef VM_THREAD_POOL_H_ | 5 #ifndef VM_THREAD_POOL_H_ |
6 #define VM_THREAD_POOL_H_ | 6 #define VM_THREAD_POOL_H_ |
7 | 7 |
8 #include "vm/thread.h" | 8 #include "vm/thread.h" |
9 | 9 |
10 namespace dart { | 10 namespace dart { |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 bool IsDone() const { return pool_ == NULL; } | 70 bool IsDone() const { return pool_ == NULL; } |
71 | 71 |
72 // Fields owned by Worker. | 72 // Fields owned by Worker. |
73 Monitor monitor_; | 73 Monitor monitor_; |
74 ThreadPool* pool_; | 74 ThreadPool* pool_; |
75 Task* task_; | 75 Task* task_; |
76 | 76 |
77 // Fields owned by ThreadPool. Workers should not look at these | 77 // Fields owned by ThreadPool. Workers should not look at these |
78 // directly. It's like looking at the sun. | 78 // directly. It's like looking at the sun. |
79 bool owned_; // Protected by ThreadPool::mutex_ | 79 bool owned_; // Protected by ThreadPool::mutex_ |
| 80 Worker* all_next_; // Protected by ThreadPool::mutex_ |
80 Worker* idle_next_; // Protected by ThreadPool::mutex_ | 81 Worker* idle_next_; // Protected by ThreadPool::mutex_ |
81 Worker* all_next_; // Protected by ThreadPool::mutex_ | |
82 | 82 |
83 DISALLOW_COPY_AND_ASSIGN(Worker); | 83 DISALLOW_COPY_AND_ASSIGN(Worker); |
84 }; | 84 }; |
85 | 85 |
86 void Shutdown(); | 86 void Shutdown(); |
87 | 87 |
88 // Expensive. Use only in assertions. | 88 // Expensive. Use only in assertions. |
89 bool IsIdle(Worker* worker); | 89 bool IsIdle(Worker* worker); |
90 | 90 |
91 bool RemoveWorkerFromIdleList(Worker* worker); | 91 bool RemoveWorkerFromIdleList(Worker* worker); |
(...skipping 14 matching lines...) Expand all Loading... |
106 | 106 |
107 static Monitor* exit_monitor_; // Used only in testing. | 107 static Monitor* exit_monitor_; // Used only in testing. |
108 static int* exit_count_; // Used only in testing. | 108 static int* exit_count_; // Used only in testing. |
109 | 109 |
110 DISALLOW_COPY_AND_ASSIGN(ThreadPool); | 110 DISALLOW_COPY_AND_ASSIGN(ThreadPool); |
111 }; | 111 }; |
112 | 112 |
113 } // namespace dart | 113 } // namespace dart |
114 | 114 |
115 #endif // VM_THREAD_POOL_H_ | 115 #endif // VM_THREAD_POOL_H_ |
OLD | NEW |