From patchwork Tue Jan 4 05:27:49 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arun Bharadwaj X-Patchwork-Id: 77387 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 C0D9EB6EEB for ; Tue, 4 Jan 2011 16:54:32 +1100 (EST) Received: from localhost ([127.0.0.1]:37992 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PZzqm-0004Xj-QB for incoming@patchwork.ozlabs.org; Tue, 04 Jan 2011 00:54:29 -0500 Received: from [140.186.70.92] (port=56256 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PZzR8-0001Rp-2p for qemu-devel@nongnu.org; Tue, 04 Jan 2011 00:27:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PZzR6-0004c8-1z for qemu-devel@nongnu.org; Tue, 04 Jan 2011 00:27:57 -0500 Received: from e28smtp07.in.ibm.com ([122.248.162.7]:47929) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PZzR4-0004c2-OL for qemu-devel@nongnu.org; Tue, 04 Jan 2011 00:27:56 -0500 Received: from d28relay03.in.ibm.com (d28relay03.in.ibm.com [9.184.220.60]) by e28smtp07.in.ibm.com (8.14.4/8.13.1) with ESMTP id p045Rpjq011022 for ; Tue, 4 Jan 2011 10:57:51 +0530 Received: from d28av02.in.ibm.com (d28av02.in.ibm.com [9.184.220.64]) by d28relay03.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p045Rpqj4145208 for ; Tue, 4 Jan 2011 10:57:51 +0530 Received: from d28av02.in.ibm.com (loopback [127.0.0.1]) by d28av02.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p045Rp54025917 for ; Tue, 4 Jan 2011 16:27:51 +1100 Received: from localhost6.localdomain6 (Crystal-Planet.in.ibm.com [9.124.35.19]) by d28av02.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p045RoNr025886; Tue, 4 Jan 2011 16:27:50 +1100 To: qemu-devel@nongnu.org From: Arun R Bharadwaj Date: Tue, 04 Jan 2011 10:57:49 +0530 Message-ID: <20110104052749.15887.35027.stgit@localhost6.localdomain6> In-Reply-To: <20110104052627.15887.43436.stgit@localhost6.localdomain6> References: <20110104052627.15887.43436.stgit@localhost6.localdomain6> User-Agent: StGit/0.15 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Cc: aliguori@us.ibm.com, stefanha@linux.vnet.ibm.com, aneesh.kumar@linux.vnet.ibm.com Subject: [Qemu-devel] [PATCH 08/13] Remove thread_create routine. 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 Remove thread_create and use qemu_thread_create instead. Signed-off-by: Arun R Bharadwaj --- posix-aio-compat.c | 19 ++----------------- 1 files changed, 2 insertions(+), 17 deletions(-) diff --git a/posix-aio-compat.c b/posix-aio-compat.c index fd9fcfd..3b01c9b 100644 --- a/posix-aio-compat.c +++ b/posix-aio-compat.c @@ -83,7 +83,6 @@ typedef struct PosixAioState { /* Default ThreadletQueue */ static ThreadletQueue globalqueue; static int globalqueue_init; -static pthread_attr_t attr; #ifdef CONFIG_PREADV static int preadv_present = 1; @@ -102,13 +101,6 @@ static void die(const char *what) die2(errno, what); } -static void thread_create(pthread_t *thread, pthread_attr_t *attr, - void *(*start_routine)(void*), void *arg) -{ - int ret = pthread_create(thread, attr, start_routine, arg); - if (ret) die2(ret, "pthread_create"); -} - static ssize_t handle_aiocb_ioctl(struct qemu_paiocb *aiocb) { int ret; @@ -375,19 +367,12 @@ static void aio_thread(ThreadletWork *work) static void spawn_threadlet(ThreadletQueue *queue) { - pthread_t thread_id; - sigset_t set, oldset; + QemuThread thread; queue->cur_threads++; queue->idle_threads++; - /* block all signals */ - if (sigfillset(&set)) die("sigfillset"); - if (sigprocmask(SIG_SETMASK, &set, &oldset)) die("sigprocmask"); - - thread_create(&thread_id, &attr, threadlet_worker, queue); - - if (sigprocmask(SIG_SETMASK, &oldset, NULL)) die("sigprocmask restore"); + qemu_thread_create(&thread, threadlet_worker, queue); }