[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [Qemu-devel] [PATCH 09/17] util: add stats64 module
From: |
Fam Zheng |
Subject: |
Re: [Qemu-block] [Qemu-devel] [PATCH 09/17] util: add stats64 module |
Date: |
Thu, 4 May 2017 15:36:15 +0800 |
User-agent: |
Mutt/1.8.0 (2017-02-23) |
On Thu, 04/20 14:00, Paolo Bonzini wrote:
> +static inline void stat64_rdlock(Stat64 *s)
> +{
> + /* Keep out incoming writers to avoid them starving us. */
> + atomic_add(&s->lock, 2);
> +
> + /* If there is a concurrent writer, wait for it. */
> + while (atomic_read(&s->lock) & 1) {
> + g_usleep(5);
What's the difference of g_usleep() from cpu_relax() in
qemu_co_mutex_lock_unlock?
> + }
> +}
Fam