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 RUNTIME_BIN_THREAD_MACOS_H_ | 5 #ifndef RUNTIME_BIN_THREAD_MACOS_H_ |
6 #define RUNTIME_BIN_THREAD_MACOS_H_ | 6 #define RUNTIME_BIN_THREAD_MACOS_H_ |
7 | 7 |
8 #if !defined(RUNTIME_BIN_THREAD_H_) | 8 #if !defined(RUNTIME_BIN_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 |
(...skipping 19 matching lines...) Expand all Loading... |
30 ASSERT(key != kUnsetThreadLocalKey); | 30 ASSERT(key != kUnsetThreadLocalKey); |
31 return reinterpret_cast<uword>(pthread_getspecific(key)); | 31 return reinterpret_cast<uword>(pthread_getspecific(key)); |
32 } | 32 } |
33 | 33 |
34 friend class Thread; | 34 friend class Thread; |
35 | 35 |
36 DISALLOW_ALLOCATION(); | 36 DISALLOW_ALLOCATION(); |
37 DISALLOW_COPY_AND_ASSIGN(ThreadInlineImpl); | 37 DISALLOW_COPY_AND_ASSIGN(ThreadInlineImpl); |
38 }; | 38 }; |
39 | 39 |
40 | |
41 class MutexData { | 40 class MutexData { |
42 private: | 41 private: |
43 MutexData() {} | 42 MutexData() {} |
44 ~MutexData() {} | 43 ~MutexData() {} |
45 | 44 |
46 pthread_mutex_t* mutex() { return &mutex_; } | 45 pthread_mutex_t* mutex() { return &mutex_; } |
47 | 46 |
48 pthread_mutex_t mutex_; | 47 pthread_mutex_t mutex_; |
49 | 48 |
50 friend class Mutex; | 49 friend class Mutex; |
51 | 50 |
52 DISALLOW_ALLOCATION(); | 51 DISALLOW_ALLOCATION(); |
53 DISALLOW_COPY_AND_ASSIGN(MutexData); | 52 DISALLOW_COPY_AND_ASSIGN(MutexData); |
54 }; | 53 }; |
55 | 54 |
56 | |
57 class MonitorData { | 55 class MonitorData { |
58 private: | 56 private: |
59 MonitorData() {} | 57 MonitorData() {} |
60 ~MonitorData() {} | 58 ~MonitorData() {} |
61 | 59 |
62 pthread_mutex_t* mutex() { return &mutex_; } | 60 pthread_mutex_t* mutex() { return &mutex_; } |
63 pthread_cond_t* cond() { return &cond_; } | 61 pthread_cond_t* cond() { return &cond_; } |
64 | 62 |
65 pthread_mutex_t mutex_; | 63 pthread_mutex_t mutex_; |
66 pthread_cond_t cond_; | 64 pthread_cond_t cond_; |
67 | 65 |
68 friend class Monitor; | 66 friend class Monitor; |
69 | 67 |
70 DISALLOW_ALLOCATION(); | 68 DISALLOW_ALLOCATION(); |
71 DISALLOW_COPY_AND_ASSIGN(MonitorData); | 69 DISALLOW_COPY_AND_ASSIGN(MonitorData); |
72 }; | 70 }; |
73 | 71 |
74 } // namespace bin | 72 } // namespace bin |
75 } // namespace dart | 73 } // namespace dart |
76 | 74 |
77 #endif // RUNTIME_BIN_THREAD_MACOS_H_ | 75 #endif // RUNTIME_BIN_THREAD_MACOS_H_ |
OLD | NEW |