summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 b796a3c..8215cca 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 a350c88..a9a3541 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