From patchwork Tue Feb 3 10:59:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Savolainen X-Patchwork-Id: 44214 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-we0-f197.google.com (mail-we0-f197.google.com [74.125.82.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BE9A72034D for ; Tue, 3 Feb 2015 11:00:14 +0000 (UTC) Received: by mail-we0-f197.google.com with SMTP id l61sf20181046wev.0 for ; Tue, 03 Feb 2015 03:00:14 -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:in-reply-to :references: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=1iq5f1KtdFSd7SqA0u2AIVTRAnX5nD2Ja4btqlrNE3A=; b=ZxOynk0JZl+XREoOFnv8JXZ9wm8p3htem4jED1SPXxLfWR1+MA0BchqvHbU/rNF7Cz TotdSffvcxwKDnzwsjKW1cASA61c851O/rsQh4HUCnf+uVwYCqJr4ZX4OsiccxrwkU8F 8y9cw8dNbL0X+bY02SRuBKO3ACX5/kc/ee/ZCB0Rcco9He1cVIEkfyU1osshJBmnGBLW gAY71wjaXe02RDV2CaIyqpA/7GBYQ9brBaBwAmG4MNyOGiwQ5dYkaxJToQIa08K7lbku cpzYNaDLDmvug47swLTzT3s/aO3amJ9kvy61TlgbIqzXwySTA5frcwBdl8kyctV7vATC PFvA== X-Gm-Message-State: ALoCoQnA+VD6WyJb+BD4my1yI3tlYlQG1nNNULujNI7Lyv1+MmGZsXwVaP1Px607xtpOwiGkbYOX X-Received: by 10.152.116.80 with SMTP id ju16mr2039068lab.1.1422961213669; Tue, 03 Feb 2015 03:00:13 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.4.10 with SMTP id ca10ls723985lad.33.gmail; Tue, 03 Feb 2015 03:00:13 -0800 (PST) X-Received: by 10.152.3.70 with SMTP id a6mr23751663laa.71.1422961213523; Tue, 03 Feb 2015 03:00:13 -0800 (PST) Received: from mail-la0-f51.google.com (mail-la0-f51.google.com. [209.85.215.51]) by mx.google.com with ESMTPS id kt1si18822083lac.129.2015.02.03.03.00.13 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Feb 2015 03:00:13 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) client-ip=209.85.215.51; Received: by mail-la0-f51.google.com with SMTP id ge10so50437570lab.10 for ; Tue, 03 Feb 2015 03:00:13 -0800 (PST) X-Received: by 10.152.20.4 with SMTP id j4mr6731435lae.29.1422961212977; Tue, 03 Feb 2015 03:00:12 -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.35.133 with SMTP id h5csp1861207lbj; Tue, 3 Feb 2015 03:00:12 -0800 (PST) X-Received: by 10.140.32.5 with SMTP id g5mr49479594qgg.83.1422961211658; Tue, 03 Feb 2015 03:00:11 -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 j8si28401502qan.55.2015.02.03.03.00.10 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 03 Feb 2015 03:00:11 -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 1YIbDE-0006dH-B5; Tue, 03 Feb 2015 11:00:08 +0000 Received: from mail-qc0-f180.google.com ([209.85.216.180]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YIbD4-0006X1-P7 for lng-odp@lists.linaro.org; Tue, 03 Feb 2015 10:59:58 +0000 Received: by mail-qc0-f180.google.com with SMTP id r5so34454083qcx.11 for ; Tue, 03 Feb 2015 02:59:53 -0800 (PST) X-Received: by 10.229.227.132 with SMTP id ja4mr7980859qcb.1.1422961193636; Tue, 03 Feb 2015 02:59:53 -0800 (PST) Received: from mcpro03.emea.nsn-net.net (ec2-23-23-178-99.compute-1.amazonaws.com. [23.23.178.99]) by mx.google.com with ESMTPSA id v15sm20959791qav.11.2015.02.03.02.59.50 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Feb 2015 02:59:52 -0800 (PST) From: Petri Savolainen To: lng-odp@lists.linaro.org Date: Tue, 3 Feb 2015 12:59:27 +0200 Message-Id: <1422961167-2307-4-git-send-email-petri.savolainen@linaro.org> X-Mailer: git-send-email 2.2.2 In-Reply-To: <1422961167-2307-1-git-send-email-petri.savolainen@linaro.org> References: <1422961167-2307-1-git-send-email-petri.savolainen@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH v2 4/4] api: thread: Added odp_thread_count 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: petri.savolainen@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.51 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 Improved thread id documentation and added odp_thread_count(), which returns number of active threads. Didn't add implementation yet Signed-off-by: Petri Savolainen --- include/odp/api/thread.h | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/include/odp/api/thread.h b/include/odp/api/thread.h index 97d5de7..f6cd09d 100644 --- a/include/odp/api/thread.h +++ b/include/odp/api/thread.h @@ -23,13 +23,29 @@ extern "C" { */ /** - * Get thread id + * Thread id * - * @return Thread id of the current thread + * Returns the thread id of the current thread. Thread ids range from 0 to + * ODP_CONFIG_MAX_THREADS-1. The ODP thread id is assinged by odp_init_local() + * and freed by odp_term_local(). Thread id is unique within the ODP instance. + * + * @return Thread id */ int odp_thread_id(void); /** + * Thread count + * + * Returns the current ODP thread count. This is the number of active threads + * running the ODP instance. Each odp_init_local() call increments and each + * odp_term_local() call decrements the count. The count is always between 1 and + * ODP_CONFIG_MAX_THREADS. + * + * @return Current thread count + */ +int odp_thread_count(void); + +/** * @} */