qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v8 13/20] jobs: group together API calls under the same job l


From: Vladimir Sementsov-Ogievskiy
Subject: Re: [PATCH v8 13/20] jobs: group together API calls under the same job lock
Date: Tue, 5 Jul 2022 17:55:51 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1

On 6/29/22 17:15, Emanuele Giuseppe Esposito wrote:
--- a/job.c
+++ b/job.c
@@ -1045,11 +1045,14 @@ static void job_completed_txn_abort_locked(Job *job)
  /* Called with job_mutex held, but releases it temporarily */
  static int job_prepare_locked(Job *job)
  {
+    int ret;
+
      GLOBAL_STATE_CODE();
      if (job->ret == 0 && job->driver->prepare) {
          job_unlock();
-        job->ret = job->driver->prepare(job);
+        ret = job->driver->prepare(job);
          job_lock();
+        job->ret = ret;
          job_update_rc_locked(job);
      }
      return job->ret;
@@ -1235,10 +1238,10 @@ void job_cancel_locked(Job *job, bool force)
           * job_cancel_async() ignores soft-cancel requests for jobs
           * that are already done (i.e. deferred to the main loop).  We
           * have to check again whether the job is really cancelled.
-         * (job_cancel_requested() and job_is_cancelled() are equivalent
-         * here, because job_cancel_async() will make soft-cancel
-         * requests no-ops when deferred_to_main_loop is true.  We
-         * choose to call job_is_cancelled() to show that we invoke
+         * (job_cancel_requested_locked() and job_is_cancelled_locked()
+         * are equivalent here, because job_cancel_async() will
+         * make soft-cancel requests no-ops when deferred_to_main_loop is true.
+         * We choose to call job_is_cancelled_locked() to show that we invoke
           * job_completed_txn_abort() only for force-cancelled jobs.)
           */
          if (job_is_cancelled_locked(job)) {

that's definitely part of commit 05

--
Best regards,
Vladimir



reply via email to

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