From 59a4daf8097c67918003efbc1a1071e2de63990a Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 1 Apr 2009 10:12:25 +0200 Subject: Revert "Make use of a thread-specific variable in qFlagLocation." This reverts commit ba25c4a832516124bcd97758de9eede32797c5a0. I hadn't meant to merge this commit as it is not ready and not OK'ed by Brad yet. --- src/corelib/kernel/qobject.cpp | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index 0e632db..05015c0 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -2179,29 +2179,13 @@ void QObject::deleteLater() Signals and slots *****************************************************************************/ -// list taken from http://en.wikipedia.org/wiki/Thread-Specific_Storage -#if defined(Q_OS_WIN) -// Some people like to dynamically load Qt (LoadLibrary), so we can't use this -#elif defined(Q_CC_GNU) && !defined(Q_WS_QWS) -// GCC has warnings about this not being ported to all archs -// So we only enable what we know to work. More archs can be added later, like Mac -# if defined(Q_OS_LINUX) && (defined(QT_ARCH_I386) || defined(QT_ARCH_X86_64) || defined(QT_ARCH_IA64)) -# define THRSPECIFIC __thread __attribute__((tls_model("local-dynamic"))) -# endif -#elif defined(Q_CC_SUN) || defined(Q_CC_INTEL) || defined(Q_CC_XLC) -# define THRSPECIFIC __thread -#endif - -#ifndef THRSPECIFIC -# define THRSPECIFIC -#endif const int flagged_locations_count = 2; -static THRSPECIFIC const char* flagged_locations[flagged_locations_count] = {0}; +static const char* flagged_locations[flagged_locations_count] = {0}; const char *qFlagLocation(const char *method) { - static THRSPECIFIC int idx = 0; + static int idx = 0; flagged_locations[idx] = method; idx = (idx+1) % flagged_locations_count; return method; -- cgit v0.12