diff options
author | Khem Raj <raj.khem@gmail.com> | 2021-03-04 11:38:40 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-03-14 16:33:59 +0000 |
commit | eec64066073428e38d5b0b6947ff302943188f65 (patch) | |
tree | ec55d656734941dee8b2a599b588a12cc174337d /meta/recipes-core/glib-2.0/glib-2.0/0021-tests-Drop-unnecessary-volatile-qualifiers-from-test.patch | |
parent | 8a74a7deca45ceef351f47a9f160df9bafc0f546 (diff) | |
download | poky-eec64066073428e38d5b0b6947ff302943188f65.tar.gz |
glib-2.0: Drop volatile qualifier
Fixes
glib/gatomic.h:112:5: error: argument 2 of '__atomic_load' discards 'volatile' qualifier [-Werror=incompatible-pointer-types]
(From OE-Core rev: 06ac55a06f2300fa5442ec73a28c3f52022cc640)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/glib-2.0/glib-2.0/0021-tests-Drop-unnecessary-volatile-qualifiers-from-test.patch')
-rw-r--r-- | meta/recipes-core/glib-2.0/glib-2.0/0021-tests-Drop-unnecessary-volatile-qualifiers-from-test.patch | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/meta/recipes-core/glib-2.0/glib-2.0/0021-tests-Drop-unnecessary-volatile-qualifiers-from-test.patch b/meta/recipes-core/glib-2.0/glib-2.0/0021-tests-Drop-unnecessary-volatile-qualifiers-from-test.patch new file mode 100644 index 0000000000..b8ed99ce15 --- /dev/null +++ b/meta/recipes-core/glib-2.0/glib-2.0/0021-tests-Drop-unnecessary-volatile-qualifiers-from-test.patch | |||
@@ -0,0 +1,51 @@ | |||
1 | From 8a112c3c6e5fe6838ee29eec7caa62ba32d9bc40 Mon Sep 17 00:00:00 2001 | ||
2 | From: Philip Withnall <pwithnall@endlessos.org> | ||
3 | Date: Wed, 11 Nov 2020 19:22:49 +0000 | ||
4 | Subject: [PATCH 21/29] tests: Drop unnecessary volatile qualifiers from tests | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | These variables were already (correctly) accessed atomically. The | ||
10 | `volatile` qualifier doesn’t help with that. | ||
11 | |||
12 | Signed-off-by: Philip Withnall <pwithnall@endlessos.org> | ||
13 | |||
14 | Helps: #600 | ||
15 | Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1719] | ||
16 | --- | ||
17 | gobject/tests/qdata.c | 2 +- | ||
18 | gobject/tests/threadtests.c | 4 ++-- | ||
19 | 2 files changed, 3 insertions(+), 3 deletions(-) | ||
20 | |||
21 | diff --git a/gobject/tests/qdata.c b/gobject/tests/qdata.c | ||
22 | index 528bdc68e..7d46efb15 100644 | ||
23 | --- a/gobject/tests/qdata.c | ||
24 | +++ b/gobject/tests/qdata.c | ||
25 | @@ -17,7 +17,7 @@ gboolean fail; | ||
26 | #define ROUNDS 10000 | ||
27 | |||
28 | GObject *object; | ||
29 | -volatile gint bucket[THREADS]; | ||
30 | +gint bucket[THREADS]; /* accessed from multiple threads, but should never be contested due to the sequence of thread operations */ | ||
31 | |||
32 | static gpointer | ||
33 | thread_func (gpointer data) | ||
34 | diff --git a/gobject/tests/threadtests.c b/gobject/tests/threadtests.c | ||
35 | index e341a9d67..b6f9e17fa 100644 | ||
36 | --- a/gobject/tests/threadtests.c | ||
37 | +++ b/gobject/tests/threadtests.c | ||
38 | @@ -27,8 +27,8 @@ | ||
39 | #include <glib.h> | ||
40 | #include <glib-object.h> | ||
41 | |||
42 | -static volatile int mtsafe_call_counter = 0; /* multi thread safe call counter */ | ||
43 | -static int unsafe_call_counter = 0; /* single-threaded call counter */ | ||
44 | +static int mtsafe_call_counter = 0; /* multi thread safe call counter, must be accessed atomically */ | ||
45 | +static int unsafe_call_counter = 0; /* single-threaded call counter */ | ||
46 | static GCond sync_cond; | ||
47 | static GMutex sync_mutex; | ||
48 | |||
49 | -- | ||
50 | 2.30.1 | ||
51 | |||