From 7f18116cbf6bcae95473ff2d41929ddef66f74c9 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Fri, 8 Apr 2011 11:04:53 +0200 Subject: Re-apply part of ba8e5eedf5f40091eb67dd391a7dcaf9299db2f5 It was somehow lost in the merge of the native symbian threads (wrong merge was cf94df01d2d2364653f2ab602688394450e92d31) --- src/corelib/thread/qthread_unix.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp index a8c5924..89546b6 100644 --- a/src/corelib/thread/qthread_unix.cpp +++ b/src/corelib/thread/qthread_unix.cpp @@ -170,18 +170,28 @@ Q_DESTRUCTOR_FUNCTION(destroy_current_thread_data_key) // Utility functions for getting, setting and clearing thread specific data. static QThreadData *get_thread_data() { +#ifdef HAVE_TLS + return currentThreadData; +#else pthread_once(¤t_thread_data_once, create_current_thread_data_key); return reinterpret_cast(pthread_getspecific(current_thread_data_key)); +#endif } static void set_thread_data(QThreadData *data) { +#ifdef HAVE_TLS + currentThreadData = data; +#endif pthread_once(¤t_thread_data_once, create_current_thread_data_key); pthread_setspecific(current_thread_data_key, data); } static void clear_thread_data() { +#ifdef HAVE_TLS + currentThreadData = 0; +#endif pthread_setspecific(current_thread_data_key, 0); } -- cgit v0.12