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