| Index: runtime/vm/dart_api_impl_test.cc
|
| diff --git a/runtime/vm/dart_api_impl_test.cc b/runtime/vm/dart_api_impl_test.cc
|
| index 2ef04569b9fc6889f030f795ff2ee916a604b5ef..77d09a05550343a9cf80dfbf254a43e77c4e6e89 100644
|
| --- a/runtime/vm/dart_api_impl_test.cc
|
| +++ b/runtime/vm/dart_api_impl_test.cc
|
| @@ -2912,7 +2912,11 @@ void BusyLoop_start(uword unused) {
|
| // on the third interrupt.
|
| static int interrupt_count = 0;
|
| static bool IsolateInterruptTestCallback() {
|
| - interrupt_count++;
|
| + {
|
| + MonitorLocker ml(sync);
|
| + interrupt_count++;
|
| + ml.Notify();
|
| + }
|
| OS::Print(" =========== Interrupt callback called #%d\n", interrupt_count);
|
| if (interrupt_count >= 3) {
|
| Dart_EnterScope();
|
| @@ -2948,11 +2952,17 @@ TEST_CASE(IsolateInterrupt) {
|
| // Send three interrupts to the other isolate. The first two allow
|
| // execution to continue. The third causes an exception in the
|
| // isolate.
|
| - Dart_InterruptIsolate(shared_isolate);
|
| - OS::Sleep(5);
|
| - Dart_InterruptIsolate(shared_isolate);
|
| - OS::Sleep(5);
|
| - Dart_InterruptIsolate(shared_isolate);
|
| + for (int i = 0; i < 3; i++) {
|
| + Dart_InterruptIsolate(shared_isolate);
|
| + OS::Sleep(5);
|
| + {
|
| + MonitorLocker ml(sync);
|
| + // Wait for interrupt_count to be increased.
|
| + while (interrupt_count == i) {
|
| + ml.Wait();
|
| + }
|
| + }
|
| + }
|
|
|
| {
|
| MonitorLocker ml(sync);
|
|
|