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 { | |
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 | |
35 class MutexData { | 19 class MutexData { |
36 private: | 20 private: |
37 MutexData() {} | 21 MutexData() {} |
38 ~MutexData() {} | 22 ~MutexData() {} |
39 | 23 |
40 pthread_mutex_t* mutex() { return &mutex_; } | 24 pthread_mutex_t* mutex() { return &mutex_; } |
41 | 25 |
42 pthread_mutex_t mutex_; | 26 pthread_mutex_t mutex_; |
43 | 27 |
44 friend class Mutex; | 28 friend class Mutex; |
(...skipping 16 matching lines...) Expand all Loading... |
61 | 45 |
62 friend class Monitor; | 46 friend class Monitor; |
63 | 47 |
64 DISALLOW_ALLOCATION(); | 48 DISALLOW_ALLOCATION(); |
65 DISALLOW_COPY_AND_ASSIGN(MonitorData); | 49 DISALLOW_COPY_AND_ASSIGN(MonitorData); |
66 }; | 50 }; |
67 | 51 |
68 } // namespace dart | 52 } // namespace dart |
69 | 53 |
70 #endif // PLATFORM_THREAD_LINUX_H_ | 54 #endif // PLATFORM_THREAD_LINUX_H_ |
OLD | NEW |