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 PLATFORM_THREAD_LINUX_H_ | 5 #ifndef PLATFORM_THREAD_LINUX_H_ |
6 #define PLATFORM_THREAD_LINUX_H_ | 6 #define PLATFORM_THREAD_LINUX_H_ |
7 | 7 |
8 #if !defined(PLATFORM_THREAD_H_) | 8 #if !defined(PLATFORM_THREAD_H_) |
9 #error Do not include thread_linux.h directly; use thread.h instead. | 9 #error Do not include thread_linux.h directly; use thread.h instead. |
10 #endif | 10 #endif |
11 | 11 |
12 #include <pthread.h> | 12 #include <pthread.h> |
13 | 13 |
14 #include "platform/assert.h" | 14 #include "platform/assert.h" |
15 #include "platform/globals.h" | 15 #include "platform/globals.h" |
16 | 16 |
17 namespace dart { | 17 namespace dart { |
18 | 18 |
19 class ThreadData { | 19 typedef pthread_t ThreadHandle; |
20 private: | |
21 ThreadData() {} | |
22 ~ThreadData() {} | |
23 | |
24 pthread_t* tid() { return &tid_; } | |
25 | |
26 pthread_t tid_; | |
27 | |
28 friend class Thread; | |
29 | |
30 DISALLOW_ALLOCATION(); | |
31 DISALLOW_COPY_AND_ASSIGN(ThreadData); | |
32 }; | |
33 | |
34 | 20 |
35 class MutexData { | 21 class MutexData { |
36 private: | 22 private: |
37 MutexData() {} | 23 MutexData() {} |
38 ~MutexData() {} | 24 ~MutexData() {} |
39 | 25 |
40 pthread_mutex_t* mutex() { return &mutex_; } | 26 pthread_mutex_t* mutex() { return &mutex_; } |
41 | 27 |
42 pthread_mutex_t mutex_; | 28 pthread_mutex_t mutex_; |
43 | 29 |
(...skipping 17 matching lines...) Expand all Loading... |
61 | 47 |
62 friend class Monitor; | 48 friend class Monitor; |
63 | 49 |
64 DISALLOW_ALLOCATION(); | 50 DISALLOW_ALLOCATION(); |
65 DISALLOW_COPY_AND_ASSIGN(MonitorData); | 51 DISALLOW_COPY_AND_ASSIGN(MonitorData); |
66 }; | 52 }; |
67 | 53 |
68 } // namespace dart | 54 } // namespace dart |
69 | 55 |
70 #endif // PLATFORM_THREAD_LINUX_H_ | 56 #endif // PLATFORM_THREAD_LINUX_H_ |
OLD | NEW |