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

Side by Side Diff: base/threading/thread_local_storage.cc

Issue 1550503002: Switch to standard integer types in base/threading/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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 | « base/threading/thread_local_storage.h ('k') | base/threading/thread_local_storage_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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/threading/thread_local_storage.h" 5 #include "base/threading/thread_local_storage.h"
6 6
7 #include "base/atomicops.h" 7 #include "base/atomicops.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "build/build_config.h"
9 10
10 using base::internal::PlatformThreadLocalStorage; 11 using base::internal::PlatformThreadLocalStorage;
11 12
12 namespace { 13 namespace {
13 // In order to make TLS destructors work, we need to keep around a function 14 // In order to make TLS destructors work, we need to keep around a function
14 // pointer to the destructor for each slot. We keep this array of pointers in a 15 // pointer to the destructor for each slot. We keep this array of pointers in a
15 // global (static) array. 16 // global (static) array.
16 // We use the single OS-level TLS slot (giving us one pointer per thread) to 17 // We use the single OS-level TLS slot (giving us one pointer per thread) to
17 // hold a pointer to a per-thread array (table) of slots that we allocate to 18 // hold a pointer to a per-thread array (table) of slots that we allocate to
18 // Chromium consumers. 19 // Chromium consumers.
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 PlatformThreadLocalStorage::GetTLSValue( 243 PlatformThreadLocalStorage::GetTLSValue(
243 base::subtle::NoBarrier_Load(&g_native_tls_key))); 244 base::subtle::NoBarrier_Load(&g_native_tls_key)));
244 if (!tls_data) 245 if (!tls_data)
245 tls_data = ConstructTlsVector(); 246 tls_data = ConstructTlsVector();
246 DCHECK_GT(slot_, 0); 247 DCHECK_GT(slot_, 0);
247 DCHECK_LT(slot_, kThreadLocalStorageSize); 248 DCHECK_LT(slot_, kThreadLocalStorageSize);
248 tls_data[slot_] = value; 249 tls_data[slot_] = value;
249 } 250 }
250 251
251 } // namespace base 252 } // namespace base
OLDNEW
« no previous file with comments | « base/threading/thread_local_storage.h ('k') | base/threading/thread_local_storage_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698