| 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 1503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1514 OS::PrintErr("in ShutdownIsolate: %s\n", error.ToErrorCString()); | 1514 OS::PrintErr("in ShutdownIsolate: %s\n", error.ToErrorCString()); |
| 1515 } | 1515 } |
| 1516 Dart::RunShutdownCallback(); | 1516 Dart::RunShutdownCallback(); |
| 1517 } | 1517 } |
| 1518 // Shut the isolate down. | 1518 // Shut the isolate down. |
| 1519 Dart::ShutdownIsolate(isolate); | 1519 Dart::ShutdownIsolate(isolate); |
| 1520 } | 1520 } |
| 1521 | 1521 |
| 1522 | 1522 |
| 1523 void Isolate::SetStickyError(RawError* sticky_error) { | 1523 void Isolate::SetStickyError(RawError* sticky_error) { |
| 1524 ASSERT(sticky_error_ == Error::null()); | 1524 ASSERT(((sticky_error_ == Error::null()) || |
| 1525 (sticky_error == Error::null())) && |
| 1526 (sticky_error != sticky_error_)); |
| 1525 sticky_error_ = sticky_error; | 1527 sticky_error_ = sticky_error; |
| 1526 message_handler()->PausedOnExit(true); | |
| 1527 } | 1528 } |
| 1528 | 1529 |
| 1529 | 1530 |
| 1530 void Isolate::Run() { | 1531 void Isolate::Run() { |
| 1531 message_handler()->Run(Dart::thread_pool(), | 1532 message_handler()->Run(Dart::thread_pool(), |
| 1532 RunIsolate, | 1533 RunIsolate, |
| 1533 ShutdownIsolate, | 1534 ShutdownIsolate, |
| 1534 reinterpret_cast<uword>(this)); | 1535 reinterpret_cast<uword>(this)); |
| 1535 } | 1536 } |
| 1536 | 1537 |
| (...skipping 1359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2896 void IsolateSpawnState::DecrementSpawnCount() { | 2897 void IsolateSpawnState::DecrementSpawnCount() { |
| 2897 ASSERT(spawn_count_monitor_ != NULL); | 2898 ASSERT(spawn_count_monitor_ != NULL); |
| 2898 ASSERT(spawn_count_ != NULL); | 2899 ASSERT(spawn_count_ != NULL); |
| 2899 MonitorLocker ml(spawn_count_monitor_); | 2900 MonitorLocker ml(spawn_count_monitor_); |
| 2900 ASSERT(*spawn_count_ > 0); | 2901 ASSERT(*spawn_count_ > 0); |
| 2901 *spawn_count_ = *spawn_count_ - 1; | 2902 *spawn_count_ = *spawn_count_ - 1; |
| 2902 ml.Notify(); | 2903 ml.Notify(); |
| 2903 } | 2904 } |
| 2904 | 2905 |
| 2905 } // namespace dart | 2906 } // namespace dart |
| OLD | NEW |