util/log: Rename qemu_log_lock to qemu_log_trylock
authorRichard Henderson <richard.henderson@linaro.org>
Sun, 17 Apr 2022 18:29:47 +0000 (11:29 -0700)
committerRichard Henderson <richard.henderson@linaro.org>
Wed, 20 Apr 2022 17:51:11 +0000 (10:51 -0700)
commitc60f599bcb9bf9256eb87c1c60add55d23f76de3
tree826787db9c46fdd8c85f1e766e789ae186312e23
parentc59fe6e536adfb2d6f3410f19d592496933f68de
util/log: Rename qemu_log_lock to qemu_log_trylock

This function can fail, which makes it more like ftrylockfile
or pthread_mutex_trylock than flockfile or pthread_mutex_lock,
so rename it.

To closer match the other trylock functions, release rcu_read_lock
along the failure path, so that qemu_log_unlock need not be called
on failure.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220417183019.755276-8-richard.henderson@linaro.org>
12 files changed:
accel/tcg/cpu-exec.c
accel/tcg/translate-all.c
accel/tcg/translator.c
cpu.c
hw/net/can/can_sja1000.c
include/exec/log.h
include/qemu/log.h
net/can/can_socketcan.c
target/i386/tcg/translate.c
tcg/tcg.c
tests/unit/test-logging.c
util/log.c