| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 "vm/isolate.h" | 5 #include "vm/isolate.h" |
| 6 | 6 |
| 7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
| 8 #include "include/dart_native_api.h" | 8 #include "include/dart_native_api.h" |
| 9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
| 10 #include "platform/text_buffer.h" | 10 #include "platform/text_buffer.h" |
| (...skipping 2586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2597 // thread in the constructor/destructor of MonitorLocker, | 2597 // thread in the constructor/destructor of MonitorLocker, |
| 2598 // so we create a MonitorLocker object which does not do any | 2598 // so we create a MonitorLocker object which does not do any |
| 2599 // no_safepoint_scope_depth increments/decrements. | 2599 // no_safepoint_scope_depth increments/decrements. |
| 2600 MonitorLocker ml(threads_lock(), false); | 2600 MonitorLocker ml(threads_lock(), false); |
| 2601 if (is_mutator) { | 2601 if (is_mutator) { |
| 2602 if (thread->sticky_error() != Error::null()) { | 2602 if (thread->sticky_error() != Error::null()) { |
| 2603 ASSERT(sticky_error_ == Error::null()); | 2603 ASSERT(sticky_error_ == Error::null()); |
| 2604 sticky_error_ = thread->sticky_error(); | 2604 sticky_error_ = thread->sticky_error(); |
| 2605 thread->clear_sticky_error(); | 2605 thread->clear_sticky_error(); |
| 2606 } | 2606 } |
| 2607 } else { |
| 2608 ASSERT(thread->api_top_scope_ == NULL); |
| 2609 ASSERT(thread->zone_ == NULL); |
| 2607 } | 2610 } |
| 2608 if (!bypass_safepoint) { | 2611 if (!bypass_safepoint) { |
| 2609 // Ensure that the thread reports itself as being at a safepoint. | 2612 // Ensure that the thread reports itself as being at a safepoint. |
| 2610 thread->EnterSafepoint(); | 2613 thread->EnterSafepoint(); |
| 2611 } | 2614 } |
| 2612 OSThread* os_thread = thread->os_thread(); | 2615 OSThread* os_thread = thread->os_thread(); |
| 2613 ASSERT(os_thread != NULL); | 2616 ASSERT(os_thread != NULL); |
| 2614 os_thread->DisableThreadInterrupts(); | 2617 os_thread->DisableThreadInterrupts(); |
| 2615 os_thread->set_thread(NULL); | 2618 os_thread->set_thread(NULL); |
| 2616 OSThread::SetCurrent(os_thread); | 2619 OSThread::SetCurrent(os_thread); |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2852 void IsolateSpawnState::DecrementSpawnCount() { | 2855 void IsolateSpawnState::DecrementSpawnCount() { |
| 2853 ASSERT(spawn_count_monitor_ != NULL); | 2856 ASSERT(spawn_count_monitor_ != NULL); |
| 2854 ASSERT(spawn_count_ != NULL); | 2857 ASSERT(spawn_count_ != NULL); |
| 2855 MonitorLocker ml(spawn_count_monitor_); | 2858 MonitorLocker ml(spawn_count_monitor_); |
| 2856 ASSERT(*spawn_count_ > 0); | 2859 ASSERT(*spawn_count_ > 0); |
| 2857 *spawn_count_ = *spawn_count_ - 1; | 2860 *spawn_count_ = *spawn_count_ - 1; |
| 2858 ml.Notify(); | 2861 ml.Notify(); |
| 2859 } | 2862 } |
| 2860 | 2863 |
| 2861 } // namespace dart | 2864 } // namespace dart |
| OLD | NEW |