Changeset 48412 in webkit for trunk/JavaScriptCore/wtf/ThreadSpecific.h
- Timestamp:
- Sep 16, 2009, 6:18:55 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/wtf/ThreadSpecific.h
r45891 r48412 80 80 struct Data : Noncopyable { 81 81 Data(T* value, ThreadSpecific<T>* owner) : value(value), owner(owner) {} 82 #if PLATFORM(QT) 83 ~Data() { owner->destroy(this); } 84 #endif 82 85 83 86 T* value; 84 87 ThreadSpecific<T>* owner; 85 #if !USE(PTHREADS) 88 #if !USE(PTHREADS) && !PLATFORM(QT) 86 89 void (*destructor)(void*); 87 90 #endif … … 137 140 inline ThreadSpecific<T>::~ThreadSpecific() 138 141 { 139 Data* data = static_cast<Data*>(m_key.localData()); 140 if (data) 141 data->destructor(data); 142 // Does not invoke destructor functions. QThreadStorage will do it 142 143 } 143 144 … … 154 155 ASSERT(!get()); 155 156 Data* data = new Data(ptr, this); 156 data->destructor = &ThreadSpecific<T>::destroy;157 157 m_key.setLocalData(data); 158 158 } … … 219 219 pthread_setspecific(data->owner->m_key, ptr); 220 220 #endif 221 221 #if PLATFORM(QT) 222 // See comment as above 223 data->owner->m_key.setLocalData(data); 224 #endif 225 222 226 data->value->~T(); 223 227 fastFree(data->value); … … 226 230 pthread_setspecific(data->owner->m_key, 0); 227 231 #elif PLATFORM(QT) 228 data->owner->m_key.setLocalData(0);232 // Do nothing here 229 233 #elif PLATFORM(WIN_OS) 230 234 TlsSetValue(tlsKeys()[data->owner->m_index], 0); … … 233 237 #endif 234 238 239 #if !PLATFORM(QT) 235 240 delete data; 241 #endif 236 242 } 237 243
Note:
See TracChangeset
for help on using the changeset viewer.