From patchwork Tue Jun 1 15:40:18 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshiaki Tamura X-Patchwork-Id: 54229 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id BC6A1B7D24 for ; Wed, 2 Jun 2010 01:50:22 +1000 (EST) Received: from localhost ([127.0.0.1]:39096 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OJTjO-0007xP-NE for incoming@patchwork.ozlabs.org; Tue, 01 Jun 2010 11:50:18 -0400 Received: from [140.186.70.92] (port=59355 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OJTaw-00020o-JZ for qemu-devel@nongnu.org; Tue, 01 Jun 2010 11:41:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OJTav-0003S3-3L for qemu-devel@nongnu.org; Tue, 01 Jun 2010 11:41:34 -0400 Received: from sh.osrg.net ([192.16.179.4]:51198) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OJTau-0003Qp-Im for qemu-devel@nongnu.org; Tue, 01 Jun 2010 11:41:33 -0400 Received: from fs.osrg.net (postfix@fs.osrg.net [10.0.0.12]) by sh.osrg.net (8.14.3/8.14.3/OSRG-NET) with ESMTP id o51FfRS6024003; Wed, 2 Jun 2010 00:41:27 +0900 Received: from localhost (hype-wd0.osrg.net [10.72.1.16]) by fs.osrg.net (Postfix) with ESMTP id 746C53E028A; Wed, 2 Jun 2010 00:41:27 +0900 (JST) From: Yoshiaki Tamura To: qemu-devel@nongnu.org Date: Wed, 2 Jun 2010 00:40:18 +0900 Message-Id: <1275406821-30024-2-git-send-email-tamura.yoshiaki@lab.ntt.co.jp> X-Mailer: git-send-email 1.7.0.31.g1df487 In-Reply-To: <1275406821-30024-1-git-send-email-tamura.yoshiaki@lab.ntt.co.jp> References: <1275406821-30024-1-git-send-email-tamura.yoshiaki@lab.ntt.co.jp> X-Dispatcher: imput version 20070423(IM149) Lines: 39 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (sh.osrg.net [192.16.179.4]); Wed, 02 Jun 2010 00:41:28 +0900 (JST) X-Virus-Scanned: clamav-milter 0.96 at sh X-Virus-Status: Clean X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Cc: aliguori@us.ibm.com, Yoshiaki Tamura Subject: [Qemu-devel] [PATCH 1/4] qemu-thread: add qemu_thread_join(). X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Add missing function to join created thread. Signed-off-by: Yoshiaki Tamura --- qemu-thread.c | 9 +++++++++ qemu-thread.h | 1 + 2 files changed, 10 insertions(+), 0 deletions(-) diff --git a/qemu-thread.c b/qemu-thread.c index afc9933..21953cd 100644 --- a/qemu-thread.c +++ b/qemu-thread.c @@ -183,3 +183,12 @@ void qemu_thread_exit(void *retval) { pthread_exit(retval); } + +void qemu_thread_join(QemuThread *thread, void **retval) +{ + int err; + + err = pthread_join(thread->thread, retval); + if (err) + error_exit(err, __func__); +} diff --git a/qemu-thread.h b/qemu-thread.h index 19bb30c..9225b33 100644 --- a/qemu-thread.h +++ b/qemu-thread.h @@ -40,5 +40,6 @@ void qemu_thread_signal(QemuThread *thread, int sig); void qemu_thread_self(QemuThread *thread); int qemu_thread_equal(QemuThread *thread1, QemuThread *thread2); void qemu_thread_exit(void *retval); +void qemu_thread_join(QemuThread *thread, void **retval); #endif