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

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

Issue 2481873005: clang-format runtime/vm (Closed)
Patch Set: Merge Created 4 years, 1 month 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 | « runtime/vm/thread_barrier.h ('k') | runtime/vm/thread_interrupter.cc » ('j') | 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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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/random.h" 6 #include "vm/random.h"
7 #include "vm/thread_barrier.h" 7 #include "vm/thread_barrier.h"
8 #include "vm/thread_pool.h" 8 #include "vm/thread_pool.h"
9 #include "vm/unit_test.h" 9 #include "vm/unit_test.h"
10 10
11 namespace dart { 11 namespace dart {
12 12
13 class FuzzTask : public ThreadPool::Task { 13 class FuzzTask : public ThreadPool::Task {
14 public: 14 public:
15 FuzzTask(intptr_t num_rounds, 15 FuzzTask(intptr_t num_rounds, ThreadBarrier* barrier, uint64_t seed)
16 ThreadBarrier* barrier, 16 : num_rounds_(num_rounds), barrier_(barrier), rng_(seed) {}
17 uint64_t seed)
18 : num_rounds_(num_rounds),
19 barrier_(barrier),
20 rng_(seed) {
21 }
22 17
23 virtual void Run() { 18 virtual void Run() {
24 for (intptr_t i = 0; i < num_rounds_; ++i) { 19 for (intptr_t i = 0; i < num_rounds_; ++i) {
25 RandomSleep(); 20 RandomSleep();
26 barrier_->Sync(); 21 barrier_->Sync();
27 } 22 }
28 barrier_->Exit(); 23 barrier_->Exit();
29 } 24 }
30 25
31 private: 26 private:
(...skipping 25 matching lines...) Expand all
57 barrier.Sync(); 52 barrier.Sync();
58 } 53 }
59 barrier.Exit(); 54 barrier.Exit();
60 } 55 }
61 56
62 delete monitor_done; 57 delete monitor_done;
63 delete monitor; 58 delete monitor;
64 } 59 }
65 60
66 } // namespace dart 61 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/thread_barrier.h ('k') | runtime/vm/thread_interrupter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698