aboutsummaryrefslogtreecommitdiff
path: root/target
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2022-04-17 11:29:47 -0700
committerRichard Henderson <richard.henderson@linaro.org>2022-04-20 10:51:11 -0700
commitc60f599bcb9bf9256eb87c1c60add55d23f76de3 (patch)
tree826787db9c46fdd8c85f1e766e789ae186312e23 /target
parentc59fe6e536adfb2d6f3410f19d592496933f68de (diff)
downloadqemu-c60f599bcb9bf9256eb87c1c60add55d23f76de3.zip
qemu-c60f599bcb9bf9256eb87c1c60add55d23f76de3.tar.gz
qemu-c60f599bcb9bf9256eb87c1c60add55d23f76de3.tar.bz2
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>
Diffstat (limited to 'target')
-rw-r--r--target/i386/tcg/translate.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c
index 3ba1c99..f3cffee 100644
--- a/target/i386/tcg/translate.c
+++ b/target/i386/tcg/translate.c
@@ -2580,7 +2580,7 @@ static void gen_unknown_opcode(CPUX86State *env, DisasContext *s)
gen_illegal_opcode(s);
if (qemu_loglevel_mask(LOG_UNIMP)) {
- FILE *logfile = qemu_log_lock();
+ FILE *logfile = qemu_log_trylock();
target_ulong pc = s->pc_start, end = s->pc;
qemu_log("ILLOPC: " TARGET_FMT_lx ":", pc);