From patchwork Thu May 19 16:27:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Milard X-Patchwork-Id: 68164 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp3280691qge; Thu, 19 May 2016 08:54:22 -0700 (PDT) X-Received: by 10.140.253.84 with SMTP id y81mr15429099qhc.56.1463673262880; Thu, 19 May 2016 08:54:22 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id q5si13165740qke.136.2016.05.19.08.54.22; Thu, 19 May 2016 08:54:22 -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 9034E617FF; Thu, 19 May 2016 15:54:22 +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 05BF361938; Thu, 19 May 2016 15:32:57 +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 D9B4861819; Thu, 19 May 2016 15:32:41 +0000 (UTC) Received: from mail-lf0-f52.google.com (mail-lf0-f52.google.com [209.85.215.52]) by lists.linaro.org (Postfix) with ESMTPS id 4E30461817 for ; Thu, 19 May 2016 15:28:59 +0000 (UTC) Received: by mail-lf0-f52.google.com with SMTP id e130so3873399lfe.3 for ; Thu, 19 May 2016 08:28:59 -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=Fq1LjNHp5Tgq5H+/sSi6uR8UdLED/l3iJpaRJVPyxRA=; b=BKp3bJ2P53cgjkg3pvv6yuek+fTImyWp+WxT+hSX6WgHY9wVMEjjPpuUF7NVjOloOl 6Z07xP2Ft2A3W8f6j/DAEAFISfE4L09m6s1UOcoYtcAoBeR3PnW6Hz9IzOnnLQPp3tle GHerqUv/LP00rMVFt3ISfoGjb/8R1qT2aoOZU+/2v7FmaWDks+OD8qHJVSQXFp3HA0JN sCYPdB/tTRVuump542ZIPuYWh2zAgp865e/Pyou7dDe7OkPjfZ//TQi4EMgEuBepJHjk Ur8Dis/V/Z1SpT9ODsObcxOuZqOyYrZy3/Zt1G+mffSAmVTBqctW1ztT2RJtN8+o+vTh Do0A== X-Gm-Message-State: AOPr4FUGZfXFomD7WK3OPFs7KJBEcFfA0W6SStHJ7mfa3dvjBjXKP8SELTykMuqicCOT9XqCtMs= X-Received: by 10.25.15.219 with SMTP id 88mr1123832lfp.123.1463671738245; Thu, 19 May 2016 08:28:58 -0700 (PDT) Received: from erachmi-ericsson.ki.sw.ericsson.se (c-83-233-90-46.cust.bredband2.com. [83.233.90.46]) by smtp.gmail.com with ESMTPSA id cv11sm2366290lbb.49.2016.05.19.08.28.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 19 May 2016 08:28:57 -0700 (PDT) From: Christophe Milard To: brian.brooks@linaro.org, maxim.uvarov@linaro.com, lng-odp@lists.linaro.org Date: Thu, 19 May 2016 18:27:08 +0200 Message-Id: <1463675234-6739-30-git-send-email-christophe.milard@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1463675234-6739-1-git-send-email-christophe.milard@linaro.org> References: <1463675234-6739-1-git-send-email-christophe.milard@linaro.org> X-Topics: timers patch Subject: [lng-odp] [PATCHv8 29/35] example: timer: 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" timer_test is changed to use the implementation agnostic ODP thread create and join functions, from helpers. timer_test is hence no longer aware on how the odpthread is implemented. Signed-off-by: Christophe Milard --- example/timer/odp_timer_test.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/example/timer/odp_timer_test.c b/example/timer/odp_timer_test.c index 3880664..2a33085 100644 --- a/example/timer/odp_timer_test.c +++ b/example/timer/odp_timer_test.c @@ -197,7 +197,7 @@ static void test_abs_timeouts(int thr, test_globals_t *gbls) * * @return Pointer to exit status */ -static void *run_thread(void *ptr) +static int run_thread(void *ptr) { int thr; odp_pool_t msg_pool; @@ -215,7 +215,7 @@ static void *run_thread(void *ptr) if (msg_pool == ODP_POOL_INVALID) { EXAMPLE_ERR(" [%i] msg_pool not found\n", thr); - return NULL; + return -1; } odp_barrier_wait(&gbls->test_barrier); @@ -225,7 +225,7 @@ static void *run_thread(void *ptr) printf("Thread %i exits\n", thr); fflush(NULL); - return NULL; + return 0; } @@ -324,7 +324,7 @@ static void parse_args(int argc, char *argv[], test_args_t *args) */ int main(int argc, char *argv[]) { - odph_linux_pthread_t thread_tbl[MAX_WORKERS]; + odph_odpthread_t thread_tbl[MAX_WORKERS]; int num_workers; odp_queue_t queue; uint64_t tick, ns; @@ -335,7 +335,7 @@ int main(int argc, char *argv[]) odp_cpumask_t cpumask; char cpumaskstr[ODP_CPUMASK_STR_SIZE]; odp_instance_t instance; - odph_linux_thr_params_t thr_params; + odph_odpthread_params_t thr_params; odp_shm_t shm = ODP_SHM_INVALID; test_globals_t *gbls = NULL; int err = 0; @@ -499,10 +499,10 @@ int main(int argc, char *argv[]) thr_params.thr_type = ODP_THREAD_WORKER; thr_params.instance = instance; - 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); /* free resources */ if (odp_queue_destroy(queue))