| 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 "bin/builtin.h" | 5 #include "bin/builtin.h" |
| 6 #include "include/dart_api.h" | 6 #include "include/dart_api.h" |
| 7 #include "include/dart_debugger_api.h" | 7 #include "include/dart_debugger_api.h" |
| 8 #include "include/dart_mirrors_api.h" | 8 #include "include/dart_mirrors_api.h" |
| 9 #include "include/dart_native_api.h" | 9 #include "include/dart_native_api.h" |
| 10 #include "platform/assert.h" | 10 #include "platform/assert.h" |
| (...skipping 7321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7332 ASSERT(interrupt_count < kInterruptCount); | 7332 ASSERT(interrupt_count < kInterruptCount); |
| 7333 return true; | 7333 return true; |
| 7334 } | 7334 } |
| 7335 | 7335 |
| 7336 | 7336 |
| 7337 TEST_CASE(IsolateInterrupt) { | 7337 TEST_CASE(IsolateInterrupt) { |
| 7338 Dart_IsolateInterruptCallback saved = Isolate::InterruptCallback(); | 7338 Dart_IsolateInterruptCallback saved = Isolate::InterruptCallback(); |
| 7339 Isolate::SetInterruptCallback(IsolateInterruptTestCallback); | 7339 Isolate::SetInterruptCallback(IsolateInterruptTestCallback); |
| 7340 | 7340 |
| 7341 sync = new Monitor(); | 7341 sync = new Monitor(); |
| 7342 int result = Thread::Start(BusyLoop_start, 0); | 7342 int result = OSThread::Start(BusyLoop_start, 0); |
| 7343 EXPECT_EQ(0, result); | 7343 EXPECT_EQ(0, result); |
| 7344 | 7344 |
| 7345 { | 7345 { |
| 7346 MonitorLocker ml(sync); | 7346 MonitorLocker ml(sync); |
| 7347 // Wait for the other isolate to enter main. | 7347 // Wait for the other isolate to enter main. |
| 7348 while (!main_entered) { | 7348 while (!main_entered) { |
| 7349 ml.Wait(); | 7349 ml.Wait(); |
| 7350 } | 7350 } |
| 7351 } | 7351 } |
| 7352 | 7352 |
| (...skipping 1364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8717 NewString("main"), | 8717 NewString("main"), |
| 8718 1, | 8718 1, |
| 8719 dart_args); | 8719 dart_args); |
| 8720 int64_t value = 0; | 8720 int64_t value = 0; |
| 8721 result = Dart_IntegerToInt64(result, &value); | 8721 result = Dart_IntegerToInt64(result, &value); |
| 8722 EXPECT_VALID(result); | 8722 EXPECT_VALID(result); |
| 8723 EXPECT_EQ(6, value); | 8723 EXPECT_EQ(6, value); |
| 8724 } | 8724 } |
| 8725 | 8725 |
| 8726 } // namespace dart | 8726 } // namespace dart |
| OLD | NEW |