Received: from eggs.gnu.org ([2001:4830:134:3::10]:54072) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMD1D-00005F-TY for qemu-devel@nongnu.org; Tue, 26 Aug 2014 05:26:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XMD16-0001kH-8c for qemu-devel@nongnu.org; Tue, 26 Aug 2014 05:26:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59359) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMD16-0001k3-1U for qemu-devel@nongnu.org; Tue, 26 Aug 2014 05:26:16 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s7Q9QFG1013106 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 26 Aug 2014 05:26:15 -0400 Date: Tue, 26 Aug 2014 17:26:32 +0800 From: Fam Zheng Message-ID: <20140826092632.GB30816@T430.nay.redhat.com> References: <1409033298-5720-1-git-send-email-famz@redhat.com> <1409033298-5720-6-git-send-email-famz@redhat.com> <53FC4888.7000201@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <53FC4888.7000201@redhat.com> Subject: Re: [Qemu-devel] [RFC PATCH v2 5/8] thread-pool: Implement .cancel_async List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Kevin Wolf , qemu-devel@nongnu.org, Stefan Hajnoczi On Tue, 08/26 10:42, Paolo Bonzini wrote: > Il 26/08/2014 08:08, Fam Zheng ha scritto: > > + qemu_mutex_lock(&pool->lock); > > + if (thread_pool_cancel_from_queue(elem)) { > > + elem->state = THREAD_CANCELED_ASYNC; > > + } > > Can you simply set it to THREAD_DONE (and set elem->ret to -ECANCELED)? > Yes, that should work. Fam