From patchwork Tue May 17 13:04:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Milard X-Patchwork-Id: 67979 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp2083410qge; Tue, 17 May 2016 06:42:32 -0700 (PDT) X-Received: by 10.140.105.182 with SMTP id c51mr1500250qgf.78.1463492552777; Tue, 17 May 2016 06:42:32 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id m186si2289347qhb.19.2016.05.17.06.42.32; Tue, 17 May 2016 06:42:32 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 6CA306178A; Tue, 17 May 2016 13:42:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 1A4786186A; Tue, 17 May 2016 13:16:53 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id C4CA0617AA; Tue, 17 May 2016 13:16:33 +0000 (UTC) Received: from mail-lf0-f48.google.com (mail-lf0-f48.google.com [209.85.215.48]) by lists.linaro.org (Postfix) with ESMTPS id 7E83C617AD for ; Tue, 17 May 2016 13:05:34 +0000 (UTC) Received: by mail-lf0-f48.google.com with SMTP id j8so6498392lfd.2 for ; Tue, 17 May 2016 06:05:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ZIn7yNpVtl7O6Je40z37LrKe6SCrmPQdejQZktlaHSw=; b=RRna54VrJRRLI6MF1gdRZKh80KyJEbUXZfhoOu19RY1vuHXEqW6ccNujtnDvfR9Yng a7ODB+i8R/LB+1nP+/VGzxDFH+LSwVX5/QFfA9z+EmrslsjqR+wHLm0Xjnm+AJwnj6F0 JNSuMLFrkQPCN9XDIAza16Gj348qZ1E3DAxTZzBZUp3dc+eU+MdXaARjCPAdWVg7/tOr 3KiZBWzopJXGR0g89czjEjlNLcSU6UOLyVQ3eJVrx1bAlT+8HQKIM4VzmJN2tCOBr2QA VLRKMR2RUaHPV/bBolF8ftEiDcH++sw7m6pvbJSPOu2b3BbiK8Ad0GW7gtMwkayr4/2n Fycw== X-Gm-Message-State: AOPr4FVOvts95xLiJ87Ccun1PfgsvrEQwh5cQUfBykknXS0wfWxaZqYi2m/2CpyF7UhtX67YAXY= X-Received: by 10.25.18.96 with SMTP id h93mr472682lfi.18.1463490333447; Tue, 17 May 2016 06:05:33 -0700 (PDT) Received: from localhost.localdomain (c-83-233-90-46.cust.bredband2.com. [83.233.90.46]) by smtp.gmail.com with ESMTPSA id q1sm506536lbo.4.2016.05.17.06.05.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 May 2016 06:05:32 -0700 (PDT) From: Christophe Milard To: lng-odp@lists.linaro.org, brian.brooks@linaro.org, mike.holmes@linaro.org Date: Tue, 17 May 2016 15:04:34 +0200 Message-Id: <1463490282-23277-28-git-send-email-christophe.milard@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1463490282-23277-1-git-send-email-christophe.milard@linaro.org> References: <1463490282-23277-1-git-send-email-christophe.milard@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv7 27/35] example: time: using agnostic function for ODP threads X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" 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" time is changed to use the implementation agnostic ODP thread create and join functions, from helpers. time is hence no longer aware on how the odpthread is implemented. Signed-off-by: Christophe Milard --- example/time/time_global_test.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/example/time/time_global_test.c b/example/time/time_global_test.c index 8e3de5c..df4da4e 100644 --- a/example/time/time_global_test.c +++ b/example/time/time_global_test.c @@ -163,7 +163,7 @@ static void test_global_timestamps(test_globals_t *gbls, * * @return Pointer to exit status */ -static void *run_thread(void *ptr) +static int run_thread(void *ptr) { int thr; uint32_t id; @@ -238,7 +238,7 @@ static void *run_thread(void *ptr) printf("Thread %i exits\n", thr); fflush(NULL); - return NULL; + return 0; } int main(void) @@ -252,9 +252,9 @@ int main(void) odp_shm_t shm_glbls = ODP_SHM_INVALID; odp_shm_t shm_log = ODP_SHM_INVALID; int log_size, log_enries_num; - odph_linux_pthread_t thread_tbl[MAX_WORKERS]; + odph_odpthread_t thread_tbl[MAX_WORKERS]; odp_instance_t instance; - odph_linux_thr_params_t thr_params; + odph_odpthread_params_t thr_params; printf("\nODP global time test starts\n"); @@ -323,10 +323,10 @@ int main(void) thr_params.instance = instance; /* Create and launch worker threads */ - odph_linux_pthread_create(thread_tbl, &cpumask, &thr_params); + odph_odpthreads_create(thread_tbl, &cpumask, &thr_params); /* Wait for worker threads to exit */ - odph_linux_pthread_join(thread_tbl, num_workers); + odph_odpthreads_join(thread_tbl); print_log(gbls);