From patchwork Thu Dec 18 11:19:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taras Kondratiuk X-Patchwork-Id: 42419 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4E5BD26C6B for ; Thu, 18 Dec 2014 11:20:02 +0000 (UTC) Received: by mail-wi0-f199.google.com with SMTP id bs8sf551282wib.6 for ; Thu, 18 Dec 2014 03:20:01 -0800 (PST) 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:subject :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=0s4uMzGDAM1i9nBw5Oz9r7WszXzBHJBnBU1jpwfyTSQ=; b=hk0WylM1565I8NIRa828elYLLtNeHqwVPEnaUVOv+eYVirW5EC/edXVvtSEsx8GxuY HDs6UjbpmaBPs6wNrgoHNn/tT6mcSK1StvcfZPQ1XzMsGSmRavaQwwWzjiKYskRJavGX hhkHO0R0WDDnGR+Q4QsGLT3H/XxBu5ZZeX5SOUJS+uN/g3vB686TAh6S96mycX2c42Fa +ze9uJRN2XhNnSKVzJkh7zQ1MN8u1w7jIoWIYuZcZpZ2UTSwz6XOVOdcjDRGlGwTGYv8 lhQc8y5geYQdj3VJj6yJgmj/FCPQmEBR1mUg9YwBuvbzbOkXKXf7eEienGVomHT9lJg9 EDFw== X-Gm-Message-State: ALoCoQlhC1JkQVPcciMYNm6P1lLpcMlqlNyWwPtxt3FrAzDE5xQEynwGzpXzpNWx1Omzw5QqB0f4 X-Received: by 10.112.32.163 with SMTP id k3mr198140lbi.17.1418901601659; Thu, 18 Dec 2014 03:20:01 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.7.7 with SMTP id f7ls26505laa.100.gmail; Thu, 18 Dec 2014 03:20:01 -0800 (PST) X-Received: by 10.112.146.37 with SMTP id sz5mr1644242lbb.27.1418901601242; Thu, 18 Dec 2014 03:20:01 -0800 (PST) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com. [209.85.215.45]) by mx.google.com with ESMTPS id jq17si6536908lab.78.2014.12.18.03.20.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 18 Dec 2014 03:20:01 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) client-ip=209.85.215.45; Received: by mail-la0-f45.google.com with SMTP id gq15so809984lab.18 for ; Thu, 18 Dec 2014 03:20:01 -0800 (PST) X-Received: by 10.112.136.69 with SMTP id py5mr1655462lbb.56.1418901601114; Thu, 18 Dec 2014 03:20:01 -0800 (PST) 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.112.142.69 with SMTP id ru5csp1670241lbb; Thu, 18 Dec 2014 03:20:00 -0800 (PST) X-Received: by 10.140.29.97 with SMTP id a88mr2201133qga.69.1418901599519; Thu, 18 Dec 2014 03:19:59 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id s52si7864617qge.11.2014.12.18.03.19.58 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 18 Dec 2014 03:19:59 -0800 (PST) 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-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Y1Z7d-0005gq-Hr; Thu, 18 Dec 2014 11:19:57 +0000 Received: from mail-la0-f53.google.com ([209.85.215.53]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Y1Z7W-0005gg-Jw for lng-odp@lists.linaro.org; Thu, 18 Dec 2014 11:19:50 +0000 Received: by mail-la0-f53.google.com with SMTP id gm9so787299lab.26 for ; Thu, 18 Dec 2014 03:19:45 -0800 (PST) X-Received: by 10.112.168.97 with SMTP id zv1mr1748869lbb.6.1418901584748; Thu, 18 Dec 2014 03:19:44 -0800 (PST) Received: from uglx0153363.synapse.com ([195.238.92.128]) by mx.google.com with ESMTPSA id ki4sm1692440lac.1.2014.12.18.03.19.43 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 18 Dec 2014 03:19:44 -0800 (PST) From: Taras Kondratiuk To: lng-odp@lists.linaro.org, petri.savolainen@nsn.com Date: Thu, 18 Dec 2014 13:19:38 +0200 Message-Id: <1418901579-29209-1-git-send-email-taras.kondratiuk@linaro.org> X-Mailer: git-send-email 1.9.1 X-Topics: patch Subject: [lng-odp] [PATCH 1/2] api: init: add a way to determine a last ODP thread termination 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: taras.kondratiuk@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.215.45 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 Signed-off-by: Taras Kondratiuk --- platform/linux-generic/include/api/odp_init.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/platform/linux-generic/include/api/odp_init.h b/platform/linux-generic/include/api/odp_init.h index 49f5e41..22ed88d 100644 --- a/platform/linux-generic/include/api/odp_init.h +++ b/platform/linux-generic/include/api/odp_init.h @@ -82,6 +82,10 @@ int odp_init_global(odp_init_t *params, odp_platform_init_t *platform_params); * In general it calls the API modules terminate functions in the reverse order * to that which the module init functions were called during odp_init_global() * + * @note This function should be called by the last ODP thread. To simplify + * synchronization between threads odp_term_local() indicates by its return + * value if it was the last thread. + * * @warning The unwinding of HW resources to allow them to be re used without reseting * the device is a complex task that the application is expected to coordinate. * This api may have platform dependant implications. @@ -120,14 +124,14 @@ int odp_init_local(void); * odp_init_local() * * @sa odp_init_local() - * @sa odp_term_global() which is the final ODP call before exit of an application. + * @sa odp_term_global() should be called by the last ODP thread before exit + * of an application. * * @warning The unwinding of HW resources to allow them to be re used without reseting * the device is a complex task that the application is expected to coordinate. - * All threads must call this function before calling - * any other ODP API functions. * - * @retval 0 if successful + * @retval 1 if successful and more ODP thread exists + * @retval 0 if successful and it was the last ODP thread * @retval -1 on failure */ int odp_term_local(void);