OLD | NEW |
---|---|
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 #ifndef BASE_THREADING_THREAD_LOCAL_STORAGE_H_ | 5 #ifndef BASE_THREADING_THREAD_LOCAL_STORAGE_H_ |
6 #define BASE_THREADING_THREAD_LOCAL_STORAGE_H_ | 6 #define BASE_THREADING_THREAD_LOCAL_STORAGE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/base_export.h" | 9 #include "base/base_export.h" |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
70 | 70 |
71 #if defined(OS_WIN) | 71 #if defined(OS_WIN) |
72 // Function called when on thread exit to call TLS | 72 // Function called when on thread exit to call TLS |
73 // destructor functions. This function is used internally. | 73 // destructor functions. This function is used internally. |
74 static void ThreadExit(); | 74 static void ThreadExit(); |
75 | 75 |
76 private: | 76 private: |
77 // Function to lazily initialize our thread local storage. | 77 // Function to lazily initialize our thread local storage. |
78 static void **Initialize(); | 78 static void **Initialize(); |
79 | 79 |
80 private: | |
81 // The maximum number of 'slots' in our thread local storage stack. | |
82 // For now, this is fixed. We could either increase statically, or | |
83 // we could make it dynamic in the future. | |
84 static const int kThreadLocalStorageSize = 64; | |
85 | |
86 static long tls_key_; | 80 static long tls_key_; |
87 static long tls_max_; | 81 static long tls_max_; |
88 static TLSDestructorFunc tls_destructors_[kThreadLocalStorageSize]; | 82 #endif // OS_WIN |
willchan no longer on Chromium
2011/11/29 21:25:31
This shouldn't be indented
jar (doing other things)
2011/11/29 21:39:08
Done.
| |
89 #endif // OS_WIN | |
90 | 83 |
91 DISALLOW_COPY_AND_ASSIGN(ThreadLocalStorage); | 84 DISALLOW_COPY_AND_ASSIGN(ThreadLocalStorage); |
92 }; | 85 }; |
93 | 86 |
94 } // namespace base | 87 } // namespace base |
95 | 88 |
96 #endif // BASE_THREADING_THREAD_LOCAL_STORAGE_H_ | 89 #endif // BASE_THREADING_THREAD_LOCAL_STORAGE_H_ |
OLD | NEW |