diff options
-rw-r--r-- | recipes-qt/qt5/qtbase/0011-Replace-pthread_yield-with-sched_yield.patch | 63 | ||||
-rw-r--r-- | recipes-qt/qt5/qtbase_git.bb | 1 |
2 files changed, 64 insertions, 0 deletions
diff --git a/recipes-qt/qt5/qtbase/0011-Replace-pthread_yield-with-sched_yield.patch b/recipes-qt/qt5/qtbase/0011-Replace-pthread_yield-with-sched_yield.patch new file mode 100644 index 00000000..ed0d4bc9 --- /dev/null +++ b/recipes-qt/qt5/qtbase/0011-Replace-pthread_yield-with-sched_yield.patch | |||
@@ -0,0 +1,63 @@ | |||
1 | From d1d4b520e29b58e427fc7bd336d34b82d0d2b1f3 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Thu, 27 Jul 2017 08:02:51 -0700 | ||
4 | Subject: [PATCH] Replace pthread_yield with sched_yield | ||
5 | |||
6 | On Linux pthead_yield is same as sched_yield implementation wise | ||
7 | and sched_yield is available on all libc | ||
8 | implementations on Linux | ||
9 | |||
10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
11 | --- | ||
12 | tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp | 4 ++-- | ||
13 | tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp | 5 +++-- | ||
14 | 2 files changed, 5 insertions(+), 4 deletions(-) | ||
15 | |||
16 | diff --git a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp | ||
17 | index 7d9f56ef38..bc115ef61d 100644 | ||
18 | --- a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp | ||
19 | +++ b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp | ||
20 | @@ -34,7 +34,7 @@ | ||
21 | #include "tst_qvariant_common.h" | ||
22 | |||
23 | #ifdef Q_OS_LINUX | ||
24 | -# include <pthread.h> | ||
25 | +# include <sched.h> | ||
26 | #endif | ||
27 | |||
28 | #include <algorithm> | ||
29 | @@ -197,7 +197,7 @@ protected: | ||
30 | const char *nm = name.constData(); | ||
31 | int tp = qRegisterMetaType<Bar>(nm); | ||
32 | #if defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID) | ||
33 | - pthread_yield(); | ||
34 | + sched_yield(); | ||
35 | #endif | ||
36 | QMetaType info(tp); | ||
37 | if (!info.isValid()) { | ||
38 | diff --git a/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp b/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp | ||
39 | index fe1057bdde..e23e97b259 100644 | ||
40 | --- a/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp | ||
41 | +++ b/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp | ||
42 | @@ -75,6 +75,7 @@ | ||
43 | #include <stdlib.h> | ||
44 | #include <sys/stat.h> | ||
45 | #include <unistd.h> | ||
46 | +#include <sched.h> | ||
47 | #endif | ||
48 | |||
49 | #include "private/qhostinfo_p.h" | ||
50 | @@ -2129,8 +2130,8 @@ public slots: | ||
51 | |||
52 | #if defined(Q_OS_MAC) | ||
53 | pthread_yield_np(); | ||
54 | -#elif defined Q_OS_LINUX && !defined Q_OS_ANDROID | ||
55 | - pthread_yield(); | ||
56 | +#elif defined Q_OS_LINUX | ||
57 | + sched_yield(); | ||
58 | #endif | ||
59 | if (!sock->waitForConnected()) { | ||
60 | networkTimeout = true; | ||
61 | -- | ||
62 | 2.13.3 | ||
63 | |||
diff --git a/recipes-qt/qt5/qtbase_git.bb b/recipes-qt/qt5/qtbase_git.bb index 7b82c00f..3523dc1c 100644 --- a/recipes-qt/qt5/qtbase_git.bb +++ b/recipes-qt/qt5/qtbase_git.bb | |||
@@ -25,6 +25,7 @@ SRC_URI += "\ | |||
25 | file://0010-Pretend-Qt5-wasn-t-found-if-OE_QMAKE_PATH_EXTERNAL_H.patch \ | 25 | file://0010-Pretend-Qt5-wasn-t-found-if-OE_QMAKE_PATH_EXTERNAL_H.patch \ |
26 | file://0001-Delete-qlonglong-and-qulonglong.patch \ | 26 | file://0001-Delete-qlonglong-and-qulonglong.patch \ |
27 | file://0010-tst_qstring-Disable-Wformat-security-with-clang-as-w.patch \ | 27 | file://0010-tst_qstring-Disable-Wformat-security-with-clang-as-w.patch \ |
28 | file://0011-Replace-pthread_yield-with-sched_yield.patch \ | ||
28 | file://run-ptest \ | 29 | file://run-ptest \ |
29 | " | 30 | " |
30 | 31 | ||