summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2013-05-05 14:24:13 -0700
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-05-06 07:28:20 +0200
commit66ebc3e079d71a22e6fef5550fa2b00ff4a9cbe9 (patch)
treede5b2223f89942aa956df513974a89224a9722ae
parent11ff42af39f1b81e8e35451bf7128cbafd294da7 (diff)
downloadqt4-tools-66ebc3e079d71a22e6fef5550fa2b00ff4a9cbe9.tar.gz
Make Qt 4.8 also compile with the LSB SDK on Linux
Generate worse code. This is similar to Qt5 commits 46bfd84fdc24fa3e3e721a5dda6cfbebe75be073 and c69106d1bf66d64e046c4f639542457151187dfc. Task-number: QTBUG-25336 Change-Id: Idd61c23d2b528db9d8c7895df008b9c1b0e2a2a4 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
-rw-r--r--src/corelib/thread/qmutex_p.h2
-rw-r--r--src/corelib/thread/qmutex_unix.cpp14
2 files changed, 8 insertions, 8 deletions
diff --git a/src/corelib/thread/qmutex_p.h b/src/corelib/thread/qmutex_p.h
index b796a3c7de..8215ccae20 100644
--- a/src/corelib/thread/qmutex_p.h
+++ b/src/corelib/thread/qmutex_p.h
@@ -79,7 +79,7 @@ public:
Qt::HANDLE owner;
uint count;
-#if defined(Q_OS_UNIX) && !defined(Q_OS_LINUX) && !defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_UNIX) && (!defined(Q_OS_LINUX) || defined(QT_LINUXBASE)) && !defined(Q_OS_SYMBIAN)
volatile bool wakeup;
pthread_mutex_t mutex;
pthread_cond_t cond;
diff --git a/src/corelib/thread/qmutex_unix.cpp b/src/corelib/thread/qmutex_unix.cpp
index a350c882d5..a9a3541207 100644
--- a/src/corelib/thread/qmutex_unix.cpp
+++ b/src/corelib/thread/qmutex_unix.cpp
@@ -56,7 +56,7 @@
#if defined(Q_OS_MAC)
# include <mach/mach.h>
# include <mach/task.h>
-#elif defined(Q_OS_LINUX)
+#elif defined(Q_OS_LINUX) && !defined(QT_LINUXBASE)
# include <linux/futex.h>
# include <sys/syscall.h>
# include <unistd.h>
@@ -65,7 +65,7 @@
QT_BEGIN_NAMESPACE
-#if !defined(Q_OS_LINUX)
+#if !defined(Q_OS_LINUX) || defined(QT_LINUXBASE)
static void report_error(int code, const char *where, const char *what)
{
if (code != 0)
@@ -77,7 +77,7 @@ static void report_error(int code, const char *where, const char *what)
QMutexPrivate::QMutexPrivate(QMutex::RecursionMode mode)
: QMutexData(mode), maximumSpinTime(MaximumSpinTimeThreshold), averageWaitTime(0), owner(0), count(0)
{
-#if !defined(Q_OS_LINUX)
+#if !defined(Q_OS_LINUX) || defined(QT_LINUXBASE)
wakeup = false;
report_error(pthread_mutex_init(&mutex, NULL), "QMutex", "mutex init");
report_error(pthread_cond_init(&cond, NULL), "QMutex", "cv init");
@@ -86,13 +86,13 @@ QMutexPrivate::QMutexPrivate(QMutex::RecursionMode mode)
QMutexPrivate::~QMutexPrivate()
{
-#if !defined(Q_OS_LINUX)
+#if !defined(Q_OS_LINUX) || defined(QT_LINUXBASE)
report_error(pthread_cond_destroy(&cond), "QMutex", "cv destroy");
report_error(pthread_mutex_destroy(&mutex), "QMutex", "mutex destroy");
#endif
}
-#if defined(Q_OS_LINUX)
+#if defined(Q_OS_LINUX) && !defined(QT_LINUXBASE)
static inline int _q_futex(volatile int *addr, int op, int val, const struct timespec *timeout, int *addr2, int val2)
{
@@ -136,7 +136,7 @@ void QMutexPrivate::wakeUp()
(void) _q_futex(&contenders._q_value, FUTEX_WAKE, 1, 0, 0, 0);
}
-#else // !Q_OS_LINUX
+#else // !Q_OS_LINUX || QT_LINUXBASE
bool QMutexPrivate::wait(int timeout)
{
@@ -183,7 +183,7 @@ void QMutexPrivate::wakeUp()
report_error(pthread_mutex_unlock(&mutex), "QMutex::unlock", "mutex unlock");
}
-#endif // !Q_OS_LINUX
+#endif // !Q_OS_LINUX || QT_LINUXBASE
QT_END_NAMESPACE