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

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

Issue 9231020: Use platform implementation of Monitor in thread pool (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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
« no previous file with comments | « runtime/bin/thread_pool.cc ('k') | runtime/bin/thread_pool_linux.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_
OLDNEW
« no previous file with comments | « runtime/bin/thread_pool.cc ('k') | runtime/bin/thread_pool_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698