diff options
Diffstat (limited to 'recipes-qt/qt5/qtbase/0008-Replace-pthread_yield-with-sched_yield.patch')
-rw-r--r-- | recipes-qt/qt5/qtbase/0008-Replace-pthread_yield-with-sched_yield.patch | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/recipes-qt/qt5/qtbase/0008-Replace-pthread_yield-with-sched_yield.patch b/recipes-qt/qt5/qtbase/0008-Replace-pthread_yield-with-sched_yield.patch new file mode 100644 index 00000000..678de529 --- /dev/null +++ b/recipes-qt/qt5/qtbase/0008-Replace-pthread_yield-with-sched_yield.patch | |||
@@ -0,0 +1,60 @@ | |||
1 | From 41d7028d2239a98a76cc91939edb2cb728019d08 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 b6106e8c9e..6d6ea0b739 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 7340817ade..f34162a105 100644 | ||
40 | --- a/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp | ||
41 | +++ b/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp | ||
42 | @@ -77,6 +77,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 | @@ -2131,8 +2132,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; | ||