From patchwork Wed Dec 3 14:17:31 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ola Liljedahl X-Patchwork-Id: 41849 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f70.google.com (mail-ee0-f70.google.com [74.125.83.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 270A825E66 for ; Wed, 3 Dec 2014 14:25:09 +0000 (UTC) Received: by mail-ee0-f70.google.com with SMTP id b57sf9741388eek.9 for ; Wed, 03 Dec 2014 06:25:08 -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=76yMgmOiy3C1LbUIM+KMQOM/vo0lsMpPkvEV2KyHTTk=; b=JjGbOFsJIyyYdzgm4DKPiv8oKFtDlf/QKV9r9uQtblwC2PJk8zNy5Qckkyp+b5IyPv Lt42NYjiobEtOfboNCvoChOvVtwcKj5fwv3VbC5diEl7yBBvAttp/pel356WPRjDBF2x FwMoGZDYRlPDB9vM18axV5+V3JDlmDYOpvoyN1Cd26Rufbg4/ekgHNh/a4uyNp2pv9JX chlyghWWvMA0J+GZ9qksJoW/SMa5romDFPu8LHgRvp5Huu5EzMNOG3gEESCSnP0j70Dy thDKNUYtMWIE7ko4IRjayZAF9lS65vdw0mc9/PJx/MC52DDQTGP/kZdKF6Le38siG8S5 yc5Q== X-Gm-Message-State: ALoCoQmgOXpQNOos85k1naaqsh8mAwfed461FNPpjHH44PO6FZGQmAuHLVJxYDlPLSnORHKq9NJd X-Received: by 10.180.94.3 with SMTP id cy3mr2164788wib.7.1417616708262; Wed, 03 Dec 2014 06:25:08 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.21.225 with SMTP id y1ls161616lae.25.gmail; Wed, 03 Dec 2014 06:25:08 -0800 (PST) X-Received: by 10.112.167.200 with SMTP id zq8mr4460778lbb.61.1417616708001; Wed, 03 Dec 2014 06:25:08 -0800 (PST) Received: from mail-la0-f46.google.com (mail-la0-f46.google.com. [209.85.215.46]) by mx.google.com with ESMTPS id jv9si23225322lab.8.2014.12.03.06.25.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Dec 2014 06:25:07 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.46 as permitted sender) client-ip=209.85.215.46; Received: by mail-la0-f46.google.com with SMTP id q1so7569307lam.5 for ; Wed, 03 Dec 2014 06:25:07 -0800 (PST) X-Received: by 10.112.189.10 with SMTP id ge10mr4427021lbc.23.1417616707835; Wed, 03 Dec 2014 06:25:07 -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.184.201 with SMTP id ew9csp672949lbc; Wed, 3 Dec 2014 06:25:04 -0800 (PST) X-Received: by 10.236.47.161 with SMTP id t21mr5952231yhb.100.1417616291799; Wed, 03 Dec 2014 06:18: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 c5si8157718qcn.25.2014.12.03.06.18.10 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 03 Dec 2014 06:18: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 1XwAkr-0003Iv-Bq; Wed, 03 Dec 2014 14:18:09 +0000 Received: from mail-la0-f51.google.com ([209.85.215.51]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XwAkW-0003Cv-8f for lng-odp@lists.linaro.org; Wed, 03 Dec 2014 14:17:48 +0000 Received: by mail-la0-f51.google.com with SMTP id ms9so12562828lab.38 for ; Wed, 03 Dec 2014 06:17:42 -0800 (PST) X-Received: by 10.152.5.198 with SMTP id u6mr4696484lau.42.1417616262154; Wed, 03 Dec 2014 06:17:42 -0800 (PST) Received: from macmini.lan (84-217-193-77.tn.glocalnet.net. [84.217.193.77]) by mx.google.com with ESMTPSA id or5sm6483330lbb.42.2014.12.03.06.17.41 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 03 Dec 2014 06:17:41 -0800 (PST) From: Ola Liljedahl To: lng-odp@lists.linaro.org Date: Wed, 3 Dec 2014 15:17:31 +0100 Message-Id: <1417616254-31760-4-git-send-email-ola.liljedahl@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1417616254-31760-1-git-send-email-ola.liljedahl@linaro.org> References: <1417616254-31760-1-git-send-email-ola.liljedahl@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH 3/6] api:odp_rwlock.h: Update doxygen comments, renaming of function params 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: ola.liljedahl@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.46 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: Ola Liljedahl --- Update doxygen comments, renaming of function params. platform/linux-generic/include/api/odp_rwlock.h | 46 ++++++++++++++----------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/platform/linux-generic/include/api/odp_rwlock.h b/platform/linux-generic/include/api/odp_rwlock.h index 59cf9cc..f3b2f71 100644 --- a/platform/linux-generic/include/api/odp_rwlock.h +++ b/platform/linux-generic/include/api/odp_rwlock.h @@ -19,56 +19,60 @@ extern "C" { #endif -/** @defgroup odp_synchronizers ODP SYNCROIZERS - * Operations to a read/write lock. +/** @defgroup odp_synchronizers ODP SYNCRONIZERS + * Operations on reader/writer locks. + * A reader/writer lock allows multiple simultaneous readers but only one + * writer at a time. + * A thread that wants write access will have to wait until there are no + * threads that want read access. This casues a risk for starvation. * @{ */ /** * The odp_rwlock_t type. - * write lock count is -1, - * read lock count > 0 */ typedef struct { - odp_atomic_u32_t cnt; /**< -1 Write lock, - > 0 for Read lock. */ + odp_atomic_u32_t cnt; /**< @private lock count + 0 lock not taken + -1 write lock taken + >0 read lock(s) taken */ } odp_rwlock_t; /** - * Initialize the rwlock to an unlocked state. + * Initialize a reader/writer lock. * - * @param rwlock pointer to the RW Lock. + * @param[out] p_rwlck Pointer to a reader/writer lock */ -void odp_rwlock_init(odp_rwlock_t *rwlock); +void odp_rwlock_init(odp_rwlock_t *p_rwlck); /** - * Aquire a read lock. + * Aquire read permission on a reader/writer lock. * - * @param rwlock pointer to a RW Lock. + * @param[in,out] p_rwlck Pointer to a reader/writer lock */ -void odp_rwlock_read_lock(odp_rwlock_t *rwlock); +void odp_rwlock_read_lock(odp_rwlock_t *p_rwlck); /** - * Release a read lock. + * Release read permission on a reader/writer lock. * - * @param rwlock pointer to the RW Lock. + * @param[in,out] p_rwlck Pointer to a reader/writer lock */ -void odp_rwlock_read_unlock(odp_rwlock_t *rwlock); +void odp_rwlock_read_unlock(odp_rwlock_t *p_rwlck); /** - * Aquire a write lock. + * Aquire write permission on a reader/writer lock. * - * @param rwlock pointer to a RW Lock. + * @param[in,out] p_rwlck Pointer to a reader/writer lock */ -void odp_rwlock_write_lock(odp_rwlock_t *rwlock); +void odp_rwlock_write_lock(odp_rwlock_t *p_rwlck); /** - * Release a write lock. + * Release write permission on a reader/writer lock. * - * @param rwlock pointer to a RW Lock. + * @param[in,out] p_rwlck Pointer to a reader/writer lock */ -void odp_rwlock_write_unlock(odp_rwlock_t *rwlock); +void odp_rwlock_write_unlock(odp_rwlock_t *p_rwlck); /** * @}