| 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 2509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2520 if (os_thread != NULL) { | 2520 if (os_thread != NULL) { |
| 2521 // We are about to associate the thread with an isolate and it would | 2521 // We are about to associate the thread with an isolate and it would |
| 2522 // not be possible to correctly track no_safepoint_scope_depth for the | 2522 // not be possible to correctly track no_safepoint_scope_depth for the |
| 2523 // thread in the constructor/destructor of MonitorLocker, | 2523 // thread in the constructor/destructor of MonitorLocker, |
| 2524 // so we create a MonitorLocker object which does not do any | 2524 // so we create a MonitorLocker object which does not do any |
| 2525 // no_safepoint_scope_depth increments/decrements. | 2525 // no_safepoint_scope_depth increments/decrements. |
| 2526 MonitorLocker ml(threads_lock(), false); | 2526 MonitorLocker ml(threads_lock(), false); |
| 2527 | 2527 |
| 2528 // If a safepoint operation is in progress wait for it | 2528 // If a safepoint operation is in progress wait for it |
| 2529 // to finish before scheduling this thread in. | 2529 // to finish before scheduling this thread in. |
| 2530 while (!bypass_safepoint && safepoint_handler()->safepoint_in_progress()) { | 2530 while (!bypass_safepoint && safepoint_handler()->SafepointInProgress()) { |
| 2531 ml.Wait(); | 2531 ml.Wait(); |
| 2532 } | 2532 } |
| 2533 | 2533 |
| 2534 // Now get a free Thread structure. | 2534 // Now get a free Thread structure. |
| 2535 thread = thread_registry()->GetFreeThreadLocked(this, is_mutator); | 2535 thread = thread_registry()->GetFreeThreadLocked(this, is_mutator); |
| 2536 ASSERT(thread != NULL); | 2536 ASSERT(thread != NULL); |
| 2537 | 2537 |
| 2538 // Set up other values and set the TLS value. | 2538 // Set up other values and set the TLS value. |
| 2539 thread->isolate_ = this; | 2539 thread->isolate_ = this; |
| 2540 ASSERT(heap() != NULL); | 2540 ASSERT(heap() != NULL); |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2831 void IsolateSpawnState::DecrementSpawnCount() { | 2831 void IsolateSpawnState::DecrementSpawnCount() { |
| 2832 ASSERT(spawn_count_monitor_ != NULL); | 2832 ASSERT(spawn_count_monitor_ != NULL); |
| 2833 ASSERT(spawn_count_ != NULL); | 2833 ASSERT(spawn_count_ != NULL); |
| 2834 MonitorLocker ml(spawn_count_monitor_); | 2834 MonitorLocker ml(spawn_count_monitor_); |
| 2835 ASSERT(*spawn_count_ > 0); | 2835 ASSERT(*spawn_count_ > 0); |
| 2836 *spawn_count_ = *spawn_count_ - 1; | 2836 *spawn_count_ = *spawn_count_ - 1; |
| 2837 ml.Notify(); | 2837 ml.Notify(); |
| 2838 } | 2838 } |
| 2839 | 2839 |
| 2840 } // namespace dart | 2840 } // namespace dart |
| OLD | NEW |