diff options
-rw-r--r-- | src/corelib/thread/qthread_unix.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp index fa47d27..e4eeb6d 100644 --- a/src/corelib/thread/qthread_unix.cpp +++ b/src/corelib/thread/qthread_unix.cpp @@ -280,15 +280,16 @@ void QThreadPrivate::createEventDispatcher(QThreadData *data) #ifndef QT_NO_THREAD -#if (defined(Q_OS_LINUX) || defined(Q_OS_MAC) || defined(Q_OS_QNX)) +#if (defined(Q_OS_LINUX) || (defined(Q_OS_MAC) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6) || defined(Q_OS_QNX)) static void setCurrentThreadName(pthread_t threadId, const char *name) { # if defined(Q_OS_LINUX) && !defined(QT_LINUXBASE) Q_UNUSED(threadId); prctl(PR_SET_NAME, (unsigned long)name, 0, 0, 0); -# elif defined(Q_OS_MAC) +# elif (defined(Q_OS_MAC) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6) Q_UNUSED(threadId); - pthread_setname_np(name); + if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_6) + pthread_setname_np(name); # elif defined(Q_OS_QNX) pthread_setname_np(threadId, name); # endif @@ -320,7 +321,7 @@ void *QThreadPrivate::start(void *arg) // ### TODO: allow the user to create a custom event dispatcher createEventDispatcher(data); -#if (defined(Q_OS_LINUX) || defined(Q_OS_MAC) || defined(Q_OS_QNX)) +#if (defined(Q_OS_LINUX) || (defined(Q_OS_MAC) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6) || defined(Q_OS_QNX)) // sets the name of the current thread. QString objectName = thr->objectName(); |