| 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 #include "platform/globals.h" | 5 #include "platform/globals.h" |
| 6 #if defined(TARGET_OS_ANDROID) | 6 #if defined(TARGET_OS_ANDROID) |
| 7 | 7 |
| 8 #include "vm/thread.h" | 8 #include "vm/thread.h" |
| 9 | 9 |
| 10 #include <errno.h> // NOLINT | 10 #include <errno.h> // NOLINT |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 | 189 |
| 190 result = pthread_mutex_init(data_.mutex(), &attr); | 190 result = pthread_mutex_init(data_.mutex(), &attr); |
| 191 // Verify that creating a pthread_mutex succeeded. | 191 // Verify that creating a pthread_mutex succeeded. |
| 192 VALIDATE_PTHREAD_RESULT(result); | 192 VALIDATE_PTHREAD_RESULT(result); |
| 193 | 193 |
| 194 result = pthread_mutexattr_destroy(&attr); | 194 result = pthread_mutexattr_destroy(&attr); |
| 195 VALIDATE_PTHREAD_RESULT(result); | 195 VALIDATE_PTHREAD_RESULT(result); |
| 196 | 196 |
| 197 // When running with assertions enabled we do track the owner. | 197 // When running with assertions enabled we do track the owner. |
| 198 #if defined(DEBUG) | 198 #if defined(DEBUG) |
| 199 ASSERT(owner_ == Isolate::Current()); | |
| 200 owner_ = NULL; | 199 owner_ = NULL; |
| 201 #endif // defined(DEBUG) | 200 #endif // defined(DEBUG) |
| 202 } | 201 } |
| 203 | 202 |
| 204 | 203 |
| 205 Mutex::~Mutex() { | 204 Mutex::~Mutex() { |
| 206 int result = pthread_mutex_destroy(data_.mutex()); | 205 int result = pthread_mutex_destroy(data_.mutex()); |
| 207 // Verify that the pthread_mutex was destroyed. | 206 // Verify that the pthread_mutex was destroyed. |
| 208 VALIDATE_PTHREAD_RESULT(result); | 207 VALIDATE_PTHREAD_RESULT(result); |
| 209 | 208 |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 | 338 |
| 340 void Monitor::NotifyAll() { | 339 void Monitor::NotifyAll() { |
| 341 // TODO(iposva): Do we need to track lock owners? | 340 // TODO(iposva): Do we need to track lock owners? |
| 342 int result = pthread_cond_broadcast(data_.cond()); | 341 int result = pthread_cond_broadcast(data_.cond()); |
| 343 VALIDATE_PTHREAD_RESULT(result); | 342 VALIDATE_PTHREAD_RESULT(result); |
| 344 } | 343 } |
| 345 | 344 |
| 346 } // namespace dart | 345 } // namespace dart |
| 347 | 346 |
| 348 #endif // defined(TARGET_OS_ANDROID) | 347 #endif // defined(TARGET_OS_ANDROID) |
| OLD | NEW |