| Index: runtime/bin/thread_pool_linux.h
|
| diff --git a/runtime/bin/thread_pool_linux.h b/runtime/bin/thread_pool_linux.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..21209b58b3d6bddc4cba8fb30939b59bd76a14bf
|
| --- /dev/null
|
| +++ b/runtime/bin/thread_pool_linux.h
|
| @@ -0,0 +1,48 @@
|
| +// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
|
| +// for details. All rights reserved. Use of this source code is governed by a
|
| +// BSD-style license that can be found in the LICENSE file.
|
| +
|
| +#ifndef BIN_THREAD_POOL_LINUX_H_
|
| +#define BIN_THREAD_POOL_LINUX_H_
|
| +
|
| +#include <pthread.h>
|
| +
|
| +#include "vm/globals.h"
|
| +
|
| +
|
| +class TaskQueueData {
|
| + private:
|
| + TaskQueueData() {}
|
| + ~TaskQueueData() {}
|
| +
|
| + pthread_mutex_t* mutex() { return &mutex_; }
|
| + pthread_cond_t* cond() { return &cond_; }
|
| +
|
| + pthread_mutex_t mutex_;
|
| + pthread_cond_t cond_;
|
| +
|
| + friend class TaskQueue;
|
| +
|
| + DISALLOW_ALLOCATION();
|
| + DISALLOW_COPY_AND_ASSIGN(TaskQueueData);
|
| +};
|
| +
|
| +
|
| +class ThreadPoolData {
|
| + private:
|
| + static const int kMaxThreadPoolSize = 16;
|
| +
|
| + ThreadPoolData() {}
|
| + ~ThreadPoolData() {}
|
| +
|
| + pthread_t* threads() { return threads_; }
|
| +
|
| + pthread_t threads_[kMaxThreadPoolSize];
|
| +
|
| + friend class ThreadPool;
|
| +
|
| + DISALLOW_ALLOCATION();
|
| + DISALLOW_COPY_AND_ASSIGN(ThreadPoolData);
|
| +};
|
| +
|
| +#endif // BIN_THREAD_POOL_LINUX_H_
|
|
|