[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v10 05/21] job.c: add job_lock/unlock while keeping job.h int
From: |
Stefan Hajnoczi |
Subject: |
Re: [PATCH v10 05/21] job.c: add job_lock/unlock while keeping job.h intact |
Date: |
Tue, 16 Aug 2022 14:31:55 -0400 |
On Mon, Jul 25, 2022 at 03:38:39AM -0400, Emanuele Giuseppe Esposito wrote:
> With "intact" we mean that all job.h functions implicitly
> take the lock. Therefore API callers are unmodified.
>
> This means that:
> - many static functions that will be always called with job lock held
> become _locked, and call _locked functions
> - all public functions take the lock internally if needed, and call _locked
> functions
> - all public functions called internally by other functions in job.c will
> have a
> _locked counterpart (sometimes public), to avoid deadlocks (job lock
> already taken).
> These functions are not used for now.
> - some public functions called only from exernal files (not job.c) do not
> have _locked() counterpart and take the lock inside. Others won't need
> the lock at all because use fields only set at initialization and
> never modified.
>
> job_{lock/unlock} is independent from real_job_{lock/unlock}.
>
> Note: at this stage, job_{lock/unlock} and job lock guard macros
> are *nop*
>
> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
> Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
> ---
> include/qemu/job.h | 138 ++++++++++-
> job.c | 600 +++++++++++++++++++++++++++++++--------------
> 2 files changed, 553 insertions(+), 185 deletions(-)
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
signature.asc
Description: PGP signature
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [PATCH v10 05/21] job.c: add job_lock/unlock while keeping job.h intact,
Stefan Hajnoczi <=