diff options
Diffstat (limited to 'meta/recipes-qt/qt5/qtbase/0008-Replace-pthread_yield-with-sched_yield.patch')
-rw-r--r-- | meta/recipes-qt/qt5/qtbase/0008-Replace-pthread_yield-with-sched_yield.patch | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/meta/recipes-qt/qt5/qtbase/0008-Replace-pthread_yield-with-sched_yield.patch b/meta/recipes-qt/qt5/qtbase/0008-Replace-pthread_yield-with-sched_yield.patch new file mode 100644 index 0000000000..84e59e7cee --- /dev/null +++ b/meta/recipes-qt/qt5/qtbase/0008-Replace-pthread_yield-with-sched_yield.patch @@ -0,0 +1,60 @@ +From aebff1455c764e9ecc73e6b52a4bac8233c93966 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Thu, 27 Jul 2017 08:02:51 -0700 +Subject: [PATCH] Replace pthread_yield with sched_yield + +On Linux pthead_yield is same as sched_yield implementation wise +and sched_yield is available on all libc +implementations on Linux + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp | 4 ++-- + tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp | 5 +++-- + 2 files changed, 5 insertions(+), 4 deletions(-) + +diff --git a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp +index e6fac74ccc..28c7e9cfb3 100644 +--- a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp ++++ b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp +@@ -35,7 +35,7 @@ + #include "tst_qvariant_common.h" + + #ifdef Q_OS_LINUX +-# include <pthread.h> ++# include <sched.h> + #endif + + #include <algorithm> +@@ -366,7 +366,7 @@ protected: + const char *nm = name.constData(); + int tp = qRegisterMetaType<Bar>(nm); + #if defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID) +- pthread_yield(); ++ sched_yield(); + #endif + QMetaType info(tp); + if (!info.isValid()) { +diff --git a/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp b/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp +index c473230246..1db8d6f225 100644 +--- a/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp ++++ b/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp +@@ -78,6 +78,7 @@ + #include <stdlib.h> + #include <sys/stat.h> + #include <unistd.h> ++#include <sched.h> + #endif + + #include "private/qhostinfo_p.h" +@@ -2132,8 +2133,8 @@ public slots: + + #if defined(Q_OS_MAC) + pthread_yield_np(); +-#elif defined Q_OS_LINUX && !defined Q_OS_ANDROID +- pthread_yield(); ++#elif defined Q_OS_LINUX ++ sched_yield(); + #endif + if (!sock->waitForConnected()) { + networkTimeout = true; |