Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(375)

Side by Side Diff: runtime/vm/debugger_api_impl_test.cc

Issue 1582683002: Fix race in Debug_InterruptIsolate which results in the following crash: (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "include/dart_mirrors_api.h" 5 #include "include/dart_mirrors_api.h"
6 #include "include/dart_tools_api.h" 6 #include "include/dart_tools_api.h"
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 #include "vm/dart_api_impl.h" 8 #include "vm/dart_api_impl.h"
9 #include "vm/lockers.h" 9 #include "vm/lockers.h"
10 #include "vm/unit_test.h" 10 #include "vm/unit_test.h"
(...skipping 1493 matching lines...) Expand 10 before | Expand all | Expand 10 after
1504 EXPECT_VALID(result); 1504 EXPECT_VALID(result);
1505 1505
1506 Dart_Handle retval = Invoke("main"); 1506 Dart_Handle retval = Invoke("main");
1507 EXPECT_VALID(retval); 1507 EXPECT_VALID(retval);
1508 Dart_ExitScope(); 1508 Dart_ExitScope();
1509 Dart_ShutdownIsolate(); 1509 Dart_ShutdownIsolate();
1510 } 1510 }
1511 1511
1512 1512
1513 TEST_CASE(Debug_InterruptIsolate) { 1513 TEST_CASE(Debug_InterruptIsolate) {
1514 sync = new Monitor();
1514 Dart_SetIsolateEventHandler(&TestInterruptIsolate); 1515 Dart_SetIsolateEventHandler(&TestInterruptIsolate);
1515 sync = new Monitor();
1516 EXPECT(interrupt_isolate_id == ILLEGAL_ISOLATE_ID); 1516 EXPECT(interrupt_isolate_id == ILLEGAL_ISOLATE_ID);
1517 Dart_SetPausedEventHandler(InterruptIsolateHandler); 1517 Dart_SetPausedEventHandler(InterruptIsolateHandler);
1518 int result = OSThread::Start("DebugInterruptIsolate", InterruptIsolateRun, 0); 1518 int result = OSThread::Start("DebugInterruptIsolate", InterruptIsolateRun, 0);
1519 EXPECT_EQ(0, result); 1519 EXPECT_EQ(0, result);
1520 1520
1521 // Wait for the test isolate to be created. 1521 // Wait for the test isolate to be created.
1522 { 1522 {
1523 MonitorLocker ml(sync); 1523 MonitorLocker ml(sync);
1524 while (interrupt_isolate_id == ILLEGAL_ISOLATE_ID) { 1524 while (interrupt_isolate_id == ILLEGAL_ISOLATE_ID) {
1525 ml.Wait(); 1525 ml.Wait();
(...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after
2321 " null, 3, 7, 1, 8, 6, 9, 10, 10, 11, 11, 13," 2321 " null, 3, 7, 1, 8, 6, 9, 10, 10, 11, 11, 13,"
2322 " null, 4, 13, 3, 14, 10," 2322 " null, 4, 13, 3, 14, 10,"
2323 " null, 5, 17, 5, 18, 9, 19, 12," 2323 " null, 5, 17, 5, 18, 9, 19, 12,"
2324 " null, 6, 21, 1," 2324 " null, 6, 21, 1,"
2325 " null, 8, 24, 1, 25, 5, 26, 6, 27, 8," 2325 " null, 8, 24, 1, 25, 5, 26, 6, 27, 8,"
2326 " null, 9, 29, 1]", 2326 " null, 9, 29, 1]",
2327 tokens_cstr); 2327 tokens_cstr);
2328 } 2328 }
2329 2329
2330 } // namespace dart 2330 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698