mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-28 21:03:54 -06:00
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>
This commit is contained in:
parent
c59fe6e536
commit
c60f599bcb
12 changed files with 18 additions and 16 deletions
|
@ -71,7 +71,7 @@ static inline void log_disas(const void *code, unsigned long size)
|
|||
/* page_dump() output to the log file: */
|
||||
static inline void log_page_dump(const char *operation)
|
||||
{
|
||||
FILE *logfile = qemu_log_lock();
|
||||
FILE *logfile = qemu_log_trylock();
|
||||
if (logfile) {
|
||||
qemu_log("page layout changed following %s\n", operation);
|
||||
page_dump(logfile);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue