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

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

Issue 1527143006: - Remove redundant (and wrong) flushing of store buffers in unit test. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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 "platform/assert.h" 5 #include "platform/assert.h"
6 #include "vm/isolate.h" 6 #include "vm/isolate.h"
7 #include "vm/lockers.h" 7 #include "vm/lockers.h"
8 #include "vm/unit_test.h" 8 #include "vm/unit_test.h"
9 #include "vm/profiler.h" 9 #include "vm/profiler.h"
10 #include "vm/thread_pool.h" 10 #include "vm/thread_pool.h"
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 Isolate* isolate_; 559 Isolate* isolate_;
560 Monitor* done_monitor_; 560 Monitor* done_monitor_;
561 bool* done_; 561 bool* done_;
562 }; 562 };
563 563
564 564
565 TEST_CASE(HelperAllocAndGC) { 565 TEST_CASE(HelperAllocAndGC) {
566 Monitor done_monitor; 566 Monitor done_monitor;
567 bool done = false; 567 bool done = false;
568 Isolate* isolate = Thread::Current()->isolate(); 568 Isolate* isolate = Thread::Current()->isolate();
569 // Flush store buffers, etc.
570 // TODO(koda): Currently, the GC only does this for the current thread, (i.e,
571 // the helper, in this test), but it should be done for all *threads*
572 // while reaching a safepoint.
573 isolate->thread_registry()->PrepareForGC();
574 Dart::thread_pool()->Run(new AllocAndGCTask(isolate, &done_monitor, &done)); 569 Dart::thread_pool()->Run(new AllocAndGCTask(isolate, &done_monitor, &done));
575 { 570 {
576 while (true) { 571 while (true) {
577 isolate->thread_registry()->CheckSafepoint(); 572 isolate->thread_registry()->CheckSafepoint();
578 MonitorLocker ml(&done_monitor); 573 MonitorLocker ml(&done_monitor);
579 if (done) { 574 if (done) {
580 break; 575 break;
581 } 576 }
582 } 577 }
583 } 578 }
584 } 579 }
585 580
586 } // namespace dart 581 } // 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