[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v8 05/20] job.c: add job_lock/unlock while keeping job.h inta
From: |
Stefan Hajnoczi |
Subject: |
Re: [PATCH v8 05/20] job.c: add job_lock/unlock while keeping job.h intact |
Date: |
Tue, 5 Jul 2022 08:39:48 +0100 |
On Wed, Jun 29, 2022 at 10:15:23AM -0400, Emanuele Giuseppe Esposito wrote:
> +void job_ref(Job *job)
> +{
> + JOB_LOCK_GUARD();
> + job_ref_locked(job);
> +}
You don't need to fix this, but just a note:
This API seems dangerous. If we don't hold the lock, how can we be sure
job won't be unreferenced before we call job_ref()? We would need to be
sure there exists another reference that won't be released until
job_ref() returns...
signature.asc
Description: PGP signature
- Re: [PATCH v8 05/20] job.c: add job_lock/unlock while keeping job.h intact,
Stefan Hajnoczi <=