Changeset 94890 in webkit for trunk/Source/JavaScriptCore/wtf/ThreadSpecific.h
- Timestamp:
- Sep 9, 2011, 5:05:28 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/wtf/ThreadSpecific.h
r76248 r94890 102 102 #endif 103 103 104 #if ENABLE(SINGLE_THREADED)105 T* m_value;106 #else107 104 #if USE(PTHREADS) 108 105 pthread_key_t m_key; … … 114 111 int m_index; 115 112 #endif 116 #endif117 113 }; 118 114 119 #if ENABLE(SINGLE_THREADED)120 template<typename T>121 inline ThreadSpecific<T>::ThreadSpecific()122 : m_value(0)123 {124 }125 126 template<typename T>127 inline T* ThreadSpecific<T>::get()128 {129 return m_value;130 }131 132 template<typename T>133 inline void ThreadSpecific<T>::set(T* ptr)134 {135 ASSERT(!get());136 m_value = ptr;137 }138 #else139 115 #if USE(PTHREADS) 140 116 template<typename T> … … 260 236 #error ThreadSpecific is not implemented for this platform. 261 237 #endif 262 #endif263 238 264 239 template<typename T> 265 240 inline void ThreadSpecific<T>::destroy(void* ptr) 266 241 { 267 #if !ENABLE(SINGLE_THREADED)268 242 Data* data = static_cast<Data*>(ptr); 269 243 … … 298 272 #if !PLATFORM(QT) 299 273 delete data; 300 #endif301 274 #endif 302 275 }
Note:
See TracChangeset
for help on using the changeset viewer.