qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v8 07/20] job.h: add _locked public functions


From: Vladimir Sementsov-Ogievskiy
Subject: Re: [PATCH v8 07/20] job.h: add _locked public functions
Date: Tue, 5 Jul 2022 13:58:08 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1

First, to subject: no function is added in this commit

Second, to my comment on previous patch: so, you decided to add "not held" 
comment to all functions, even that have public _locked() counterpart.
Not sure we really need it, but it's OK. Anyway, let's just add all these 
comments together with the functions themselves in patch 05.


On 6/29/22 17:15, Emanuele Giuseppe Esposito wrote:
These functions will be used later when we use the job lock.

Note: at this stage, job_{lock/unlock} and job lock guard macros
are *nop*.

Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
---
  include/qemu/job.h | 15 ++++++++++++---
  1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/include/qemu/job.h b/include/qemu/job.h
index b714236c1a..e887f88cb2 100644
--- a/include/qemu/job.h
+++ b/include/qemu/job.h
@@ -505,7 +505,10 @@ const char *job_type_str(const Job *job);
  /** Returns true if the job should not be visible to the management layer. */
  bool job_is_internal(Job *job);
-/** Returns whether the job is being cancelled. */
+/**
+ * Returns whether the job is being cancelled.
+ * Called with job_mutex *not* held.
+ */
  bool job_is_cancelled(Job *job);
/* Same as job_is_cancelled(), but called with job lock held. */
@@ -518,13 +521,19 @@ bool job_is_cancelled_locked(Job *job);
   */
  bool job_cancel_requested(Job *job);
-/** Returns whether the job is in a completed state. */
+/**
+ * Returns whether the job is in a completed state.
+ * Called with job_mutex *not* held.
+ */
  bool job_is_completed(Job *job);
/* Same as job_is_completed(), but called with job lock held. */
  bool job_is_completed_locked(Job *job);
-/** Returns whether the job is ready to be completed. */
+/**
+ * Returns whether the job is ready to be completed.
+ * Called with job_mutex *not* held.
+ */
  bool job_is_ready(Job *job);
/* Same as job_is_ready(), but called with job lock held. */


--
Best regards,
Vladimir



reply via email to

[Prev in Thread] Current Thread [Next in Thread]