| 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 #include "vm/thread_pool.h" | 5 #include "vm/thread_pool.h" |
| 6 | 6 |
| 7 #include "vm/flags.h" |
| 8 #include "vm/lockers.h" |
| 9 |
| 7 namespace dart { | 10 namespace dart { |
| 8 | 11 |
| 9 DEFINE_FLAG(int, worker_timeout_millis, 5000, | 12 DEFINE_FLAG(int, worker_timeout_millis, 5000, |
| 10 "Free workers when they have been idle for this amount of time."); | 13 "Free workers when they have been idle for this amount of time."); |
| 11 | 14 |
| 12 Monitor* ThreadPool::exit_monitor_ = NULL; | 15 Monitor* ThreadPool::exit_monitor_ = NULL; |
| 13 int* ThreadPool::exit_count_ = NULL; | 16 int* ThreadPool::exit_count_ = NULL; |
| 14 | 17 |
| 15 ThreadPool::ThreadPool() | 18 ThreadPool::ThreadPool() |
| 16 : shutting_down_(false), | 19 : shutting_down_(false), |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 // The exit monitor is only used during testing. | 325 // The exit monitor is only used during testing. |
| 323 if (ThreadPool::exit_monitor_) { | 326 if (ThreadPool::exit_monitor_) { |
| 324 MonitorLocker ml(ThreadPool::exit_monitor_); | 327 MonitorLocker ml(ThreadPool::exit_monitor_); |
| 325 (*ThreadPool::exit_count_)++; | 328 (*ThreadPool::exit_count_)++; |
| 326 ml.Notify(); | 329 ml.Notify(); |
| 327 } | 330 } |
| 328 delete worker; | 331 delete worker; |
| 329 } | 332 } |
| 330 | 333 |
| 331 } // namespace dart | 334 } // namespace dart |
| OLD | NEW |