Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(377)

Side by Side Diff: runtime/bin/thread_pool_linux.h

Issue 8983017: Start of thread pool implementation (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments from ager@ Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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_LINUX_H_
6 #define BIN_THREAD_POOL_LINUX_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 ThreadPoolData() {}
34 ~ThreadPoolData() {}
35
36 pthread_t* threads() { return threads_; }
37 void set_threads(pthread_t* threads) { threads_ = threads; }
38
39 pthread_t* threads_;
40
41 friend class ThreadPool;
42
43 DISALLOW_ALLOCATION();
44 DISALLOW_COPY_AND_ASSIGN(ThreadPoolData);
45 };
46
47 #endif // BIN_THREAD_POOL_LINUX_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698