diff options
author | Kristian Monsen <kristianm@google.com> | 2010-09-08 12:18:00 +0100 |
---|---|---|
committer | Kristian Monsen <kristianm@google.com> | 2010-09-11 12:08:58 +0100 |
commit | 5ddde30071f639962dd557c453f2ad01f8f0fd00 (patch) | |
tree | 775803c4ab35af50aa5f5472cd1fb95fe9d5152d /JavaScriptCore/wtf/ThreadSpecific.h | |
parent | 3e63d9b33b753ca86d0765d1b3d711114ba9e34f (diff) | |
download | external_webkit-5ddde30071f639962dd557c453f2ad01f8f0fd00.zip external_webkit-5ddde30071f639962dd557c453f2ad01f8f0fd00.tar.gz external_webkit-5ddde30071f639962dd557c453f2ad01f8f0fd00.tar.bz2 |
Merge WebKit at r66666 : Initial merge by git.
Change-Id: I57dedeb49859adc9c539e760f0e749768c66626f
Diffstat (limited to 'JavaScriptCore/wtf/ThreadSpecific.h')
-rw-r--r-- | JavaScriptCore/wtf/ThreadSpecific.h | 30 |
1 files changed, 6 insertions, 24 deletions
diff --git a/JavaScriptCore/wtf/ThreadSpecific.h b/JavaScriptCore/wtf/ThreadSpecific.h index 893f561..93ed466 100644 --- a/JavaScriptCore/wtf/ThreadSpecific.h +++ b/JavaScriptCore/wtf/ThreadSpecific.h @@ -67,12 +67,17 @@ public: T* operator->(); operator T*(); T& operator*(); - ~ThreadSpecific(); private: #if !USE(PTHREADS) && !PLATFORM(QT) && !PLATFORM(GTK) && OS(WINDOWS) friend void ThreadSpecificThreadExit(); #endif + + // Not implemented. It's technically possible to destroy a thread specific key, but one would need + // to make sure that all values have been destroyed already (usually, that all threads that used it + // have exited). It's unlikely that any user of this call will be in that situation - and having + // a destructor defined can be confusing, given that it has such strong pre-requisites to work correctly. + ~ThreadSpecific(); T* get(); void set(T*); @@ -116,11 +121,6 @@ inline ThreadSpecific<T>::ThreadSpecific() } template<typename T> -inline ThreadSpecific<T>::~ThreadSpecific() -{ -} - -template<typename T> inline T* ThreadSpecific<T>::get() { return m_value; @@ -143,12 +143,6 @@ inline ThreadSpecific<T>::ThreadSpecific() } template<typename T> -inline ThreadSpecific<T>::~ThreadSpecific() -{ - pthread_key_delete(m_key); // Does not invoke destructor functions. -} - -template<typename T> inline T* ThreadSpecific<T>::get() { Data* data = static_cast<Data*>(pthread_getspecific(m_key)); @@ -170,12 +164,6 @@ inline ThreadSpecific<T>::ThreadSpecific() } template<typename T> -inline ThreadSpecific<T>::~ThreadSpecific() -{ - // Does not invoke destructor functions. QThreadStorage will do it -} - -template<typename T> inline T* ThreadSpecific<T>::get() { Data* data = static_cast<Data*>(m_key.localData()); @@ -199,12 +187,6 @@ inline ThreadSpecific<T>::ThreadSpecific() } template<typename T> -inline ThreadSpecific<T>::~ThreadSpecific() -{ - g_static_private_free(&m_key); -} - -template<typename T> inline T* ThreadSpecific<T>::get() { Data* data = static_cast<Data*>(g_static_private_get(&m_key)); |