From patchwork Fri May 20 16:30:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Milard X-Patchwork-Id: 68282 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp3861132qge; Fri, 20 May 2016 08:58:27 -0700 (PDT) X-Received: by 10.55.68.78 with SMTP id r75mr4123336qka.189.1463759907117; Fri, 20 May 2016 08:58:27 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id o66si18714547qkd.123.2016.05.20.08.58.26; Fri, 20 May 2016 08:58:27 -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 BA24B61701; Fri, 20 May 2016 15:58:26 +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 6CB7E61937; Fri, 20 May 2016 15:36:37 +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 7C13061900; Fri, 20 May 2016 15:36:32 +0000 (UTC) Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com [209.85.217.173]) by lists.linaro.org (Postfix) with ESMTPS id 31C8661823 for ; Fri, 20 May 2016 15:32:35 +0000 (UTC) Received: by mail-lb0-f173.google.com with SMTP id ww9so36596530lbc.2 for ; Fri, 20 May 2016 08:32:35 -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=EsPUOTLDb/aX+yHqah+Q98WOWPzCL+TRzXjT1+3P8hdDuKlpROtsLiw4vh+g3uxP5Y KVM4mYFm3tePIpIUZwxkQaQLo2uxIHPC0wQkjWo6B5JcV9CexjIktuTSQixOTN0b44/k c9GreF8QhbKEgnGHW8NogPUuL7BRGVwtAw40U3uZKjrWf74CLJDgL4IccYphJsBqYQsB Y501rkq+91uyoiva6e7JOU/57TstdGZeU5WoszKLFyqA0hZPgdZ62eCeWpzUjlyioATt LyNJSFL8o8mguZfu2sKd19YlzQ1gMhzj/2A4xjGuBXFWYXyvm+v0Khtokh2k6Mbg11fv Z6wA== X-Gm-Message-State: AOPr4FWUHd6BL/8QzWrhwXtc9JJz8GYi5ApHbX7oNimH7s0AgRBcki3C9iumi/7qZXsbvrlGMsc= X-Received: by 10.112.171.98 with SMTP id at2mr1191632lbc.124.1463758350956; Fri, 20 May 2016 08:32:30 -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 tg1sm3348847lbb.7.2016.05.20.08.32.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 20 May 2016 08:32:30 -0700 (PDT) From: Christophe Milard To: maxim.uvarov@linaro.com, lng-odp@lists.linaro.org Date: Fri, 20 May 2016 18:30:45 +0200 Message-Id: <1463761851-37121-30-git-send-email-christophe.milard@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1463761851-37121-1-git-send-email-christophe.milard@linaro.org> References: <1463761851-37121-1-git-send-email-christophe.milard@linaro.org> X-Topics: timers patch Subject: [lng-odp] [PATCHv9 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))