From patchwork Wed Jul 30 12:16:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Santosh Shukla X-Patchwork-Id: 34516 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f199.google.com (mail-pd0-f199.google.com [209.85.192.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 25D3A21330 for ; Wed, 30 Jul 2014 12:17:26 +0000 (UTC) Received: by mail-pd0-f199.google.com with SMTP id ft15sf6605151pdb.2 for ; Wed, 30 Jul 2014 05:17:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:subject:precedence:list-id:list-unsubscribe:list-archive :list-post:list-help:list-subscribe:mime-version:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list :content-type:content-transfer-encoding; bh=HdiSVH73TaYJPNNG/rmZBOTapPekvMs4f9NhnPkOhO0=; b=KnRYXlb5tdKnr0QKNAcQZtgL3RYUKf42EoQ8Sy5MQTNzC5M0WjFv3dGrF9Nc5bcUqM ABWKTuVEgqI8TcPeLb3qDHpcRL5L6L55HSvFSZZcSjRJVD8Li5eSLUk2gpr6P2GwIaao nhJHXUiHwRhh5FxIqmmxoIGqpQCQohzMMmenmpKEh8df7Mn9dODtiI6epomfDK/JuSGo ivdVv/NngxzLVCZyrLC5hQt96WsQKeAatqLDYfGt1MxW3e/ArYZDiQjBav/36Ymfvza8 V9ehvdpqYe4i41iusr5A2WFeoJVoGrKBN3PTfyWEOvE0zI3U2ihQr1Q2WhC05BEbx2vR ygpA== X-Gm-Message-State: ALoCoQnkaegPSMzCcw9ba0EPEoXYzxeKdAtZ48QL/ue1aoyZx28cvSLk/2pV73L/pyPAVJ6getT7 X-Received: by 10.70.98.164 with SMTP id ej4mr1572116pdb.3.1406722645385; Wed, 30 Jul 2014 05:17:25 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.19.33 with SMTP id 30ls539340qgg.34.gmail; Wed, 30 Jul 2014 05:17:25 -0700 (PDT) X-Received: by 10.220.68.140 with SMTP id v12mr3781055vci.13.1406722645272; Wed, 30 Jul 2014 05:17:25 -0700 (PDT) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id ey8si1421462vdc.18.2014.07.30.05.17.25 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 30 Jul 2014 05:17:25 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.174 as permitted sender) client-ip=209.85.220.174; Received: by mail-vc0-f174.google.com with SMTP id la4so1591844vcb.33 for ; Wed, 30 Jul 2014 05:17:25 -0700 (PDT) X-Received: by 10.52.248.146 with SMTP id ym18mr7329663vdc.8.1406722645202; Wed, 30 Jul 2014 05:17:25 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp22713vcb; Wed, 30 Jul 2014 05:17:24 -0700 (PDT) X-Received: by 10.52.0.209 with SMTP id 17mr7356163vdg.60.1406722637096; Wed, 30 Jul 2014 05:17:17 -0700 (PDT) Received: from ip-10-141-164-156.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id u3si3577180qcz.27.2014.07.30.05.16.47 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 30 Jul 2014 05:17:17 -0700 (PDT) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-141-164-156.ec2.internal) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XCSoI-0005eH-R1; Wed, 30 Jul 2014 12:16:46 +0000 Received: from mail-pa0-f46.google.com ([209.85.220.46]) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XCSoD-0005e2-0q for lng-odp@lists.linaro.org; Wed, 30 Jul 2014 12:16:41 +0000 Received: by mail-pa0-f46.google.com with SMTP id lj1so1417290pab.19 for ; Wed, 30 Jul 2014 05:16:35 -0700 (PDT) X-Received: by 10.66.136.14 with SMTP id pw14mr4171251pab.140.1406722595417; Wed, 30 Jul 2014 05:16:35 -0700 (PDT) Received: from santosh-Latitude-E5530-non-vPro.10.0.0.5 ([111.93.218.67]) by mx.google.com with ESMTPSA id ln10sm2164524pbc.96.2014.07.30.05.16.32 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 30 Jul 2014 05:16:34 -0700 (PDT) From: Santosh Shukla To: lng-odp@lists.linaro.org Date: Wed, 30 Jul 2014 17:46:11 +0530 Message-Id: <1406722571-23556-2-git-send-email-santosh.shukla@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1406722571-23556-1-git-send-email-santosh.shukla@linaro.org> References: <1406722571-23556-1-git-send-email-santosh.shukla@linaro.org> X-Topics: timers patch Subject: [lng-odp] [PATCH 2/2] timer : replace pthread_create with pthread_create_single X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: lng-odp-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: santosh.shukla@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.174 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 replacing pthread_create with pthread_create_single would fix incorrect thread_tbl[] entry problem, Previously pthread_join used to have wrong thread_tbl[] index entry to exit which lead to segfault in some platform, noticed on x-gen and on my x86 server machine too. This patch should fix that problem. Signed-off-by: santosh shukla --- test/api_test/odp_timer_ping.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/test/api_test/odp_timer_ping.c b/test/api_test/odp_timer_ping.c index cd67e0d..ba5b4f8 100644 --- a/test/api_test/odp_timer_ping.c +++ b/test/api_test/odp_timer_ping.c @@ -362,13 +362,16 @@ int main(int argc ODP_UNUSED, char *argv[] ODP_UNUSED) void *(*run_thread) (void *); if (i == 0) - run_thread = rx_ping; - else run_thread = send_ping; + else + run_thread = rx_ping; - /* Create and launch worker threads */ - odp_linux_pthread_create(thread_tbl, 1, i, - run_thread, (pthrd_arg *)&pingarg); + /* Create and launch worker threads + * and pin to (i) core number + * */ + odp_linux_pthread_create_single(thread_tbl, i, i, + run_thread, + (pthrd_arg *)&pingarg); } /* Wait for worker threads to exit */