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

Side by Side Diff: webrtc/rtc_base/criticalsection_unittest.cc

Issue 2977953002: Partial Reland of Make the default ctor of rtc::Thread, protected (Closed)
Patch Set: Fix the same error elsewhere Created 3 years, 5 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 | « webrtc/pc/test/fakeaudiocapturemodule.cc ('k') | webrtc/rtc_base/logging_unittest.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 /* 1 /*
2 * Copyright 2014 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2014 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 static int AtomicOp(int* i) { return AtomicOps::Decrement(i); } 194 static int AtomicOp(int* i) { return AtomicOps::Decrement(i); }
195 }; 195 };
196 196
197 struct CompareAndSwapOp { 197 struct CompareAndSwapOp {
198 static int AtomicOp(int* i) { return AtomicOps::CompareAndSwap(i, 0, 1); } 198 static int AtomicOp(int* i) { return AtomicOps::CompareAndSwap(i, 0, 1); }
199 }; 199 };
200 200
201 void StartThreads(std::vector<std::unique_ptr<Thread>>* threads, 201 void StartThreads(std::vector<std::unique_ptr<Thread>>* threads,
202 MessageHandler* handler) { 202 MessageHandler* handler) {
203 for (int i = 0; i < kNumThreads; ++i) { 203 for (int i = 0; i < kNumThreads; ++i) {
204 std::unique_ptr<Thread> thread(new Thread()); 204 std::unique_ptr<Thread> thread(Thread::Create());
205 thread->Start(); 205 thread->Start();
206 thread->Post(RTC_FROM_HERE, handler); 206 thread->Post(RTC_FROM_HERE, handler);
207 threads->push_back(std::move(thread)); 207 threads->push_back(std::move(thread));
208 } 208 }
209 } 209 }
210 210
211 } // namespace 211 } // namespace
212 212
213 TEST(AtomicOpsTest, Simple) { 213 TEST(AtomicOpsTest, Simple) {
214 int value = 0; 214 int value = 0;
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 for (auto& t : threads) 404 for (auto& t : threads)
405 t.Start(&test_data, kThreadRepeats, 1); 405 t.Start(&test_data, kThreadRepeats, 1);
406 406
407 event.Wait(Event::kForever); 407 event.Wait(Event::kForever);
408 408
409 for (auto& t : threads) 409 for (auto& t : threads)
410 t.Stop(); 410 t.Stop();
411 } 411 }
412 412
413 } // namespace rtc 413 } // namespace rtc
OLDNEW
« no previous file with comments | « webrtc/pc/test/fakeaudiocapturemodule.cc ('k') | webrtc/rtc_base/logging_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698