summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Lezcano <daniel.lezcano@linaro.org>2021-08-16 15:49:59 +0200
committerDaniel Lezcano <daniel.lezcano@linaro.org>2021-08-16 15:49:59 +0200
commit35b874af5fb9ab9420c5e0e4b34f1152d825d848 (patch)
tree06c948a036086a1c16609badeed9130d6c79b391
parent31776068e6a0c4659adcb8645a9217785be368b2 (diff)
Add thread attribute to global variables
The libnl does not allow to retrieve the 'err' and 'ack' pointers, thus we are forced to use global variables. However, this is not thread safe, add the __thread annotation to have per thread variables. This is fine, as it is not a shared resource across the threads. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
-rw-r--r--src/netlink.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/netlink.c b/src/netlink.c
index 4fdd361..9ebb7e2 100644
--- a/src/netlink.c
+++ b/src/netlink.c
@@ -13,8 +13,8 @@ struct handler_args {
int id;
};
-static int err;
-static int done;
+static __thread int err;
+static __thread int done;
static int nl_seq_check_handler(struct nl_msg *msg, void *arg)
{