[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] job: delete job_{lock, unlock} functions and replace them wi
From: |
Paolo Bonzini |
Subject: |
Re: [PATCH] job: delete job_{lock, unlock} functions and replace them with lock guard |
Date: |
Wed, 30 Sep 2020 15:17:58 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 |
On 30/09/20 14:15, Elena Afanasova wrote:
>>> + WITH_QEMU_LOCK_GUARD(&job_mutex) {
>>> + if (ns != -1) {
>>> + timer_mod(&job->sleep_timer, ns);
>>> + }
>>> + job->busy = false;
>>> + job_event_idle(job);
>> Is this new macro safe to use in a coroutine context?
> Hi, I suppose it's safe. It would be nice to get some more opinions
> here.
>
Yes, the macro is just a wrapper around the qemu_mutex_lock/unlock
functions (or qemu_co_mutex_lock/unlock depending on the type of its
argument).
Paolo