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

Side by Side Diff: include/core/SkRefCnt.h

Issue 258783005: Revert of teach TSAN about SkSpinlock, SkRefCnt, and SkOnce (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 7 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 1
2 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #ifndef SkRefCnt_DEFINED 10 #ifndef SkRefCnt_DEFINED
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 */ 100 */
101 void internal_dispose_restore_refcnt_to_1() const { 101 void internal_dispose_restore_refcnt_to_1() const {
102 #ifdef SK_DEBUG 102 #ifdef SK_DEBUG
103 SkASSERT(0 == fRefCnt); 103 SkASSERT(0 == fRefCnt);
104 fRefCnt = 1; 104 fRefCnt = 1;
105 #endif 105 #endif
106 } 106 }
107 107
108 private: 108 private:
109 // OK for use in asserts, but not much else. 109 // OK for use in asserts, but not much else.
110 int32_t unsafeGetRefCnt() const { return SK_ANNOTATE_UNPROTECTED_READ(fRefCn t); } 110 int32_t unsafeGetRefCnt() { return SK_ANNOTATE_UNPROTECTED_READ(fRefCnt); }
111 111
112 /** 112 /**
113 * Called when the ref count goes to 0. 113 * Called when the ref count goes to 0.
114 */ 114 */
115 virtual void internal_dispose() const { 115 virtual void internal_dispose() const {
116 this->internal_dispose_restore_refcnt_to_1(); 116 this->internal_dispose_restore_refcnt_to_1();
117 SkDELETE(this); 117 SkDELETE(this);
118 } 118 }
119 119
120 // The following friends are those which override internal_dispose() 120 // The following friends are those which override internal_dispose()
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 typedef T* SkRefPtr::*unspecified_bool_type; 289 typedef T* SkRefPtr::*unspecified_bool_type;
290 operator unspecified_bool_type() const { 290 operator unspecified_bool_type() const {
291 return fObj ? &SkRefPtr::fObj : NULL; 291 return fObj ? &SkRefPtr::fObj : NULL;
292 } 292 }
293 293
294 private: 294 private:
295 T* fObj; 295 T* fObj;
296 }; 296 };
297 297
298 #endif 298 #endif
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