| 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 BIN_THREAD_POOL_LINUX_H_ | 5 #ifndef BIN_THREAD_POOL_LINUX_H_ |
| 6 #define BIN_THREAD_POOL_LINUX_H_ | 6 #define BIN_THREAD_POOL_LINUX_H_ |
| 7 | 7 |
| 8 #include <pthread.h> | 8 #include <pthread.h> |
| 9 | 9 |
| 10 #include "platform/globals.h" | 10 #include "platform/globals.h" |
| 11 | 11 |
| 12 | 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 { | 13 class ThreadPoolData { |
| 32 private: | 14 private: |
| 33 ThreadPoolData() {} | 15 ThreadPoolData() {} |
| 34 ~ThreadPoolData() {} | 16 ~ThreadPoolData() {} |
| 35 | 17 |
| 36 pthread_t* threads() { return threads_; } | 18 pthread_t* threads() { return threads_; } |
| 37 void set_threads(pthread_t* threads) { threads_ = threads; } | 19 void set_threads(pthread_t* threads) { threads_ = threads; } |
| 38 | 20 |
| 39 pthread_t* threads_; | 21 pthread_t* threads_; |
| 40 | 22 |
| 41 friend class ThreadPool; | 23 friend class ThreadPool; |
| 42 | 24 |
| 43 DISALLOW_ALLOCATION(); | 25 DISALLOW_ALLOCATION(); |
| 44 DISALLOW_COPY_AND_ASSIGN(ThreadPoolData); | 26 DISALLOW_COPY_AND_ASSIGN(ThreadPoolData); |
| 45 }; | 27 }; |
| 46 | 28 |
| 47 #endif // BIN_THREAD_POOL_LINUX_H_ | 29 #endif // BIN_THREAD_POOL_LINUX_H_ |
| OLD | NEW |