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

Side by Side Diff: tests/RefCntTest.cpp

Issue 1867863002: Convert SkRefCnt to std::atomic. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Restore to 1. Created 4 years, 8 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 | « src/gpu/batches/GrBatch.h ('k') | tests/TLSTest.cpp » ('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 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkRefCnt.h" 8 #include "SkRefCnt.h"
9 #include "SkThreadUtils.h" 9 #include "SkThreadUtils.h"
10 #include "SkTypes.h" 10 #include "SkTypes.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 SkASSERT(thing2.start()); 64 SkASSERT(thing2.start());
65 SkASSERT(thing3.start()); 65 SkASSERT(thing3.start());
66 SkASSERT(thing4.start()); 66 SkASSERT(thing4.start());
67 67
68 thing1.join(); 68 thing1.join();
69 thing2.join(); 69 thing2.join();
70 thing3.join(); 70 thing3.join();
71 thing4.join(); 71 thing4.join();
72 72
73 REPORTER_ASSERT(reporter, ref->unique()); 73 REPORTER_ASSERT(reporter, ref->unique());
74 REPORTER_ASSERT(reporter, ref->getWeakCnt() == 1); 74 SkDEBUGCODE(REPORTER_ASSERT(reporter, ref->getWeakCnt() == 1));
75 ref->unref(); 75 ref->unref();
76 } 76 }
77 77
78 DEF_TEST(RefCnt, reporter) { 78 DEF_TEST(RefCnt, reporter) {
79 test_refCnt(reporter); 79 test_refCnt(reporter);
80 test_weakRefCnt(reporter); 80 test_weakRefCnt(reporter);
81 } 81 }
82 82
83 //////////////////////////////////////////////////////////////////////////////// /////////////////// 83 //////////////////////////////////////////////////////////////////////////////// ///////////////////
84 84
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 REPORTER_ASSERT(r, rc->unique()); 391 REPORTER_ASSERT(r, rc->unique());
392 392
393 { 393 {
394 sk_sp<SkRefCnt> sp = sk_ref_sp(rc); 394 sk_sp<SkRefCnt> sp = sk_ref_sp(rc);
395 REPORTER_ASSERT(r, !rc->unique()); 395 REPORTER_ASSERT(r, !rc->unique());
396 } 396 }
397 397
398 REPORTER_ASSERT(r, rc->unique()); 398 REPORTER_ASSERT(r, rc->unique());
399 rc->unref(); 399 rc->unref();
400 } 400 }
OLDNEW
« no previous file with comments | « src/gpu/batches/GrBatch.h ('k') | tests/TLSTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698