libbpf: Ensure print callback usage is thread-safe
authorJP Kobryn <inwardvessel@gmail.com>
Sat, 25 Mar 2023 01:08:45 +0000 (18:08 -0700)
committerAndrii Nakryiko <andrii@kernel.org>
Mon, 27 Mar 2023 18:33:43 +0000 (11:33 -0700)
commitf1cb927cdb6280e0ce283174cc1bf395dffc43d4
treed9797bbb0073a28680c76bf7fe862a4272d5a285
parent5f5a7d8d8bd461f515543040ad7d107cc405d30c
libbpf: Ensure print callback usage is thread-safe

This patch prevents races on the print function pointer, allowing the
libbpf_set_print() function to become thread-safe.

Signed-off-by: JP Kobryn <inwardvessel@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20230325010845.46000-1-inwardvessel@gmail.com
tools/lib/bpf/libbpf.c
tools/lib/bpf/libbpf.h