| 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 VM_OS_THREAD_H_ | 5 #ifndef VM_OS_THREAD_H_ |
| 6 #define VM_OS_THREAD_H_ | 6 #define VM_OS_THREAD_H_ |
| 7 | 7 |
| 8 #include "platform/globals.h" | 8 #include "platform/globals.h" |
| 9 #include "vm/globals.h" | 9 #include "vm/globals.h" |
| 10 | 10 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 ~Mutex(); | 67 ~Mutex(); |
| 68 | 68 |
| 69 void Lock(); | 69 void Lock(); |
| 70 bool TryLock(); | 70 bool TryLock(); |
| 71 void Unlock(); | 71 void Unlock(); |
| 72 | 72 |
| 73 #if defined(DEBUG) | 73 #if defined(DEBUG) |
| 74 bool IsOwnedByCurrentThread() const { | 74 bool IsOwnedByCurrentThread() const { |
| 75 return owner_ == OSThread::GetCurrentThreadId(); | 75 return owner_ == OSThread::GetCurrentThreadId(); |
| 76 } | 76 } |
| 77 #endif // defined(DEBUG) | 77 #else |
| 78 bool IsOwnedByCurrentThread() const { |
| 79 UNREACHABLE(); |
| 80 return false; |
| 81 } |
| 82 #endif |
| 78 | 83 |
| 79 private: | 84 private: |
| 80 MutexData data_; | 85 MutexData data_; |
| 81 #if defined(DEBUG) | 86 #if defined(DEBUG) |
| 82 ThreadId owner_; | 87 ThreadId owner_; |
| 83 #endif // defined(DEBUG) | 88 #endif // defined(DEBUG) |
| 84 | 89 |
| 85 DISALLOW_COPY_AND_ASSIGN(Mutex); | 90 DISALLOW_COPY_AND_ASSIGN(Mutex); |
| 86 }; | 91 }; |
| 87 | 92 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 113 MonitorData data_; // OS-specific data. | 118 MonitorData data_; // OS-specific data. |
| 114 | 119 |
| 115 DISALLOW_COPY_AND_ASSIGN(Monitor); | 120 DISALLOW_COPY_AND_ASSIGN(Monitor); |
| 116 }; | 121 }; |
| 117 | 122 |
| 118 | 123 |
| 119 } // namespace dart | 124 } // namespace dart |
| 120 | 125 |
| 121 | 126 |
| 122 #endif // VM_OS_THREAD_H_ | 127 #endif // VM_OS_THREAD_H_ |
| OLD | NEW |