From 5ddde30071f639962dd557c453f2ad01f8f0fd00 Mon Sep 17 00:00:00 2001 From: Kristian Monsen Date: Wed, 8 Sep 2010 12:18:00 +0100 Subject: Merge WebKit at r66666 : Initial merge by git. Change-Id: I57dedeb49859adc9c539e760f0e749768c66626f --- JavaScriptCore/wtf/ThreadSpecific.h | 30 ++++++------------------------ 1 file changed, 6 insertions(+), 24 deletions(-) (limited to 'JavaScriptCore/wtf/ThreadSpecific.h') 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::ThreadSpecific() } template -inline ThreadSpecific::~ThreadSpecific() -{ -} - -template inline T* ThreadSpecific::get() { return m_value; @@ -143,12 +143,6 @@ inline ThreadSpecific::ThreadSpecific() } template -inline ThreadSpecific::~ThreadSpecific() -{ - pthread_key_delete(m_key); // Does not invoke destructor functions. -} - -template inline T* ThreadSpecific::get() { Data* data = static_cast(pthread_getspecific(m_key)); @@ -170,12 +164,6 @@ inline ThreadSpecific::ThreadSpecific() } template -inline ThreadSpecific::~ThreadSpecific() -{ - // Does not invoke destructor functions. QThreadStorage will do it -} - -template inline T* ThreadSpecific::get() { Data* data = static_cast(m_key.localData()); @@ -199,12 +187,6 @@ inline ThreadSpecific::ThreadSpecific() } template -inline ThreadSpecific::~ThreadSpecific() -{ - g_static_private_free(&m_key); -} - -template inline T* ThreadSpecific::get() { Data* data = static_cast(g_static_private_get(&m_key)); -- cgit v1.1