[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v8 07/20] job.h: add _locked public functions
From: |
Emanuele Giuseppe Esposito |
Subject: |
[PATCH v8 07/20] job.h: add _locked public functions |
Date: |
Wed, 29 Jun 2022 10:15:25 -0400 |
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. */
--
2.31.1
- [PATCH v8 00/20] job: replace AioContext lock with job_mutex, Emanuele Giuseppe Esposito, 2022/06/29
- [PATCH v8 07/20] job.h: add _locked public functions,
Emanuele Giuseppe Esposito <=
- [PATCH v8 01/20] job.c: make job_mutex and job_lock/unlock() public, Emanuele Giuseppe Esposito, 2022/06/29
- [PATCH v8 09/20] blockjob: rename notifier callbacks as _locked, Emanuele Giuseppe Esposito, 2022/06/29
- [PATCH v8 04/20] aio-wait.h: introduce AIO_WAIT_WHILE_UNLOCKED, Emanuele Giuseppe Esposito, 2022/06/29
- [PATCH v8 02/20] job.h: categorize fields in struct Job, Emanuele Giuseppe Esposito, 2022/06/29
- [PATCH v8 10/20] jobs: add job lock in find_* functions, Emanuele Giuseppe Esposito, 2022/06/29
- [PATCH v8 06/20] job.h: define functions called without job lock held, Emanuele Giuseppe Esposito, 2022/06/29
- [PATCH v8 11/20] jobs: use job locks also in the unit tests, Emanuele Giuseppe Esposito, 2022/06/29
- [PATCH v8 08/20] blockjob.h: introduce block_job _locked() APIs, Emanuele Giuseppe Esposito, 2022/06/29
- [PATCH v8 03/20] job.c: API functions not used outside should be static, Emanuele Giuseppe Esposito, 2022/06/29
- [PATCH v8 15/20] job: detect change of aiocontext within job coroutine, Emanuele Giuseppe Esposito, 2022/06/29