Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // BSD-style license that can be found in the LICENSE file. | |
| 4 | |
| 5 #ifndef BIN_THREAD_POOL_MACOS_H_ | |
| 6 #define BIN_THREAD_POOL_MACOS_H_ | |
| 7 | |
| 8 #include <pthread.h> | |
| 9 | |
| 10 #include "vm/globals.h" | |
| 11 | |
| 12 | |
| 13 class TaskQueueData { | |
| 14 private: | |
| 15 TaskQueueData() {} | |
| 16 ~TaskQueueData() {} | |
| 17 | |
| 18 pthread_mutex_t* mutex() { return &mutex_; } | |
| 19 pthread_cond_t* cond() { return &cond_; } | |
| 20 | |
| 21 pthread_mutex_t mutex_; | |
| 22 pthread_cond_t cond_; | |
| 23 | |
| 24 friend class TaskQueue; | |
| 25 | |
| 26 DISALLOW_ALLOCATION(); | |
| 27 DISALLOW_COPY_AND_ASSIGN(TaskQueueData); | |
| 28 }; | |
| 29 | |
| 30 | |
| 31 class ThreadPoolData { | |
| 32 private: | |
| 33 static const int kMaxThreadPoolSize = 16; | |
|
Mads Ager (google)
2012/01/04 14:32:46
You could set this in the constructor to Platform:
Søren Gjesse
2012/01/04 15:15:07
Removed the constant alltogether. threads_ is now
| |
| 34 | |
| 35 ThreadPoolData() {} | |
| 36 ~ThreadPoolData() {} | |
| 37 | |
| 38 pthread_t* threads() { return threads_; } | |
| 39 | |
| 40 pthread_t threads_[kMaxThreadPoolSize]; | |
| 41 | |
| 42 friend class ThreadPool; | |
| 43 | |
| 44 DISALLOW_ALLOCATION(); | |
| 45 DISALLOW_COPY_AND_ASSIGN(ThreadPoolData); | |
| 46 }; | |
| 47 | |
| 48 #endif // BIN_THREAD_POOL_MACOS_H_ | |
| OLD | NEW |