| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 private: | 79 private: |
| 80 using StaticSlot::initialized_; | 80 using StaticSlot::initialized_; |
| 81 #if defined(OS_WIN) | 81 #if defined(OS_WIN) |
| 82 using StaticSlot::slot_; | 82 using StaticSlot::slot_; |
| 83 #elif defined(OS_POSIX) | 83 #elif defined(OS_POSIX) |
| 84 using StaticSlot::key_; | 84 using StaticSlot::key_; |
| 85 #endif | 85 #endif |
| 86 DISALLOW_COPY_AND_ASSIGN(Slot); | 86 DISALLOW_COPY_AND_ASSIGN(Slot); |
| 87 }; | 87 }; |
| 88 | 88 |
| 89 #if defined(OS_WIN) | |
| 90 // Function called when on thread exit to call TLS | |
| 91 // destructor functions. This function is used internally. | |
| 92 static void ThreadExit(); | |
| 93 | |
| 94 private: | |
| 95 // Function to lazily initialize our thread local storage. | |
| 96 static void **Initialize(); | |
| 97 | |
| 98 static long tls_key_; | |
| 99 static long tls_max_; | |
| 100 #endif // OS_WIN | |
| 101 | |
| 102 DISALLOW_COPY_AND_ASSIGN(ThreadLocalStorage); | 89 DISALLOW_COPY_AND_ASSIGN(ThreadLocalStorage); |
| 103 }; | 90 }; |
| 104 | 91 |
| 105 } // namespace base | 92 } // namespace base |
| 106 | 93 |
| 107 #endif // BASE_THREADING_THREAD_LOCAL_STORAGE_H_ | 94 #endif // BASE_THREADING_THREAD_LOCAL_STORAGE_H_ |
| OLD | NEW |