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

Side by Side Diff: base/threading/thread_local.h

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_id_name_manager.h ('k') | base/threading/thread_local_posix.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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 // WARNING: Thread local storage is a bit tricky to get right. Please make 5 // WARNING: Thread local storage is a bit tricky to get right. Please make
6 // sure that this is really the proper solution for what you're trying to 6 // sure that this is really the proper solution for what you're trying to
7 // achieve. Don't prematurely optimize, most likely you can just use a Lock. 7 // achieve. Don't prematurely optimize, most likely you can just use a Lock.
8 // 8 //
9 // These classes implement a wrapper around the platform's TLS storage 9 // These classes implement a wrapper around the platform's TLS storage
10 // mechanism. On construction, they will allocate a TLS slot, and free the 10 // mechanism. On construction, they will allocate a TLS slot, and free the
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 // // Return the current MyClass associated with the calling thread, can be 45 // // Return the current MyClass associated with the calling thread, can be
46 // // NULL if there isn't a MyClass associated. 46 // // NULL if there isn't a MyClass associated.
47 // MyClass* MyClass::current() { 47 // MyClass* MyClass::current() {
48 // return Singleton<ThreadLocalPointer<MyClass> >::get()->Get(); 48 // return Singleton<ThreadLocalPointer<MyClass> >::get()->Get();
49 // } 49 // }
50 50
51 #ifndef BASE_THREADING_THREAD_LOCAL_H_ 51 #ifndef BASE_THREADING_THREAD_LOCAL_H_
52 #define BASE_THREADING_THREAD_LOCAL_H_ 52 #define BASE_THREADING_THREAD_LOCAL_H_
53 53
54 #include "base/base_export.h" 54 #include "base/base_export.h"
55 #include "base/basictypes.h" 55 #include "base/macros.h"
56 #include "base/threading/thread_local_storage.h" 56 #include "base/threading/thread_local_storage.h"
57 #include "build/build_config.h"
57 58
58 #if defined(OS_POSIX) 59 #if defined(OS_POSIX)
59 #include <pthread.h> 60 #include <pthread.h>
60 #endif 61 #endif
61 62
62 namespace base { 63 namespace base {
63 namespace internal { 64 namespace internal {
64 65
65 // Helper functions that abstract the cross-platform APIs. Do not use directly. 66 // Helper functions that abstract the cross-platform APIs. Do not use directly.
66 struct BASE_EXPORT ThreadLocalPlatform { 67 struct BASE_EXPORT ThreadLocalPlatform {
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 125
125 private: 126 private:
126 ThreadLocalPointer<void> tlp_; 127 ThreadLocalPointer<void> tlp_;
127 128
128 DISALLOW_COPY_AND_ASSIGN(ThreadLocalBoolean); 129 DISALLOW_COPY_AND_ASSIGN(ThreadLocalBoolean);
129 }; 130 };
130 131
131 } // namespace base 132 } // namespace base
132 133
133 #endif // BASE_THREADING_THREAD_LOCAL_H_ 134 #endif // BASE_THREADING_THREAD_LOCAL_H_
OLDNEW
« no previous file with comments | « base/threading/thread_id_name_manager.h ('k') | base/threading/thread_local_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698