| OLD | NEW |
| 1 /* | |
| 2 * Copyright 2012 Google Inc. | |
| 3 * | |
| 4 * Use of this source code is governed by a BSD-style license that can be | |
| 5 * found in the LICENSE file. | |
| 6 */ | |
| 7 | |
| 8 #include "SkTLS.h" | 1 #include "SkTLS.h" |
| 9 | 2 |
| 10 // enable to help debug TLS storage | 3 // enable to help debug TLS storage |
| 11 //#define SK_TRACE_TLS_LIFETIME | 4 //#define SK_TRACE_TLS_LIFETIME |
| 12 | 5 |
| 13 | 6 |
| 14 #ifdef SK_TRACE_TLS_LIFETIME | 7 #ifdef SK_TRACE_TLS_LIFETIME |
| 15 #include "SkAtomics.h" | 8 #include "SkThread.h" |
| 16 static int32_t gTLSRecCount; | 9 static int32_t gTLSRecCount; |
| 17 #endif | 10 #endif |
| 18 | 11 |
| 19 struct SkTLSRec { | 12 struct SkTLSRec { |
| 20 SkTLSRec* fNext; | 13 SkTLSRec* fNext; |
| 21 void* fData; | 14 void* fData; |
| 22 SkTLS::CreateProc fCreateProc; | 15 SkTLS::CreateProc fCreateProc; |
| 23 SkTLS::DeleteProc fDeleteProc; | 16 SkTLS::DeleteProc fDeleteProc; |
| 24 | 17 |
| 25 #ifdef SK_TRACE_TLS_LIFETIME | 18 #ifdef SK_TRACE_TLS_LIFETIME |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 // we have a new head of our chain | 114 // we have a new head of our chain |
| 122 SkTLS::PlatformSetSpecific(next); | 115 SkTLS::PlatformSetSpecific(next); |
| 123 } | 116 } |
| 124 SkDELETE(curr); | 117 SkDELETE(curr); |
| 125 break; | 118 break; |
| 126 } | 119 } |
| 127 prev = curr; | 120 prev = curr; |
| 128 curr = next; | 121 curr = next; |
| 129 } | 122 } |
| 130 } | 123 } |
| OLD | NEW |