From patchwork Thu Dec 4 15:38:52 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ola Liljedahl X-Patchwork-Id: 41942 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f71.google.com (mail-ee0-f71.google.com [74.125.83.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B29C82486D for ; Thu, 4 Dec 2014 15:39:32 +0000 (UTC) Received: by mail-ee0-f71.google.com with SMTP id c13sf11234501eek.2 for ; Thu, 04 Dec 2014 07:39:31 -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=eXiq0SQrBVX0uCIWT+Qn57Grbf0c+Vj5CrErEKN99g4=; b=gurW67Af+0uAnIMjYIGZMZqudJacP5b6hveEnB27zs6cKd8t64Zybp0Z6a/29rqLe3 N4g6AvrDlKjszH2OCpqmziJcMlCBnaFRfL4I0BSigADXKbcoXs3Clww6aWap0V0qheGK w0rJzOBQO+3Fv/uHUUqoMuPll4WmwEt3+cWD+CLKinyA7/FbSaEUwaiUiBS+4gBwOzJi g90UTGWLORAOABQnpzNqkC4RX8XEbzQtXUV4K3hqRP9XcyT8bkS1b394dewl+tlnn9dO 24QHNS0Iias8b3NTC5pk/o3dyc9oH3S484QkSHOswayh//7HzCXgRxjfRaYbakvRl+6n EzLw== X-Gm-Message-State: ALoCoQlLcGCvIBIIdrm65Mj0mrlVwH8SxQOFtBspPwYJyfBg5kS2tXngeitP8CNUsK23Te2casBN X-Received: by 10.112.14.2 with SMTP id l2mr2377762lbc.5.1417707571893; Thu, 04 Dec 2014 07:39:31 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.135 with SMTP id s7ls102372las.33.gmail; Thu, 04 Dec 2014 07:39:31 -0800 (PST) X-Received: by 10.112.202.71 with SMTP id kg7mr10017404lbc.16.1417707571750; Thu, 04 Dec 2014 07:39:31 -0800 (PST) Received: from mail-la0-f47.google.com (mail-la0-f47.google.com. [209.85.215.47]) by mx.google.com with ESMTPS id u8si26221003lau.133.2014.12.04.07.39.31 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 04 Dec 2014 07:39:31 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 as permitted sender) client-ip=209.85.215.47; Received: by mail-la0-f47.google.com with SMTP id hz20so14302800lab.6 for ; Thu, 04 Dec 2014 07:39:31 -0800 (PST) X-Received: by 10.112.189.10 with SMTP id ge10mr9899578lbc.23.1417707571665; Thu, 04 Dec 2014 07:39:31 -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 ew9csp56618lbc; Thu, 4 Dec 2014 07:39:30 -0800 (PST) X-Received: by 10.224.40.72 with SMTP id j8mr17757690qae.59.1417707570289; Thu, 04 Dec 2014 07:39:30 -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 a2si31728239qam.24.2014.12.04.07.39.29 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 04 Dec 2014 07:39:30 -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 1XwYV6-0004Sd-J8; Thu, 04 Dec 2014 15:39:28 +0000 Received: from mail-la0-f41.google.com ([209.85.215.41]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XwYUk-0004PV-Vy for lng-odp@lists.linaro.org; Thu, 04 Dec 2014 15:39:07 +0000 Received: by mail-la0-f41.google.com with SMTP id hv19so9815979lab.14 for ; Thu, 04 Dec 2014 07:39:01 -0800 (PST) X-Received: by 10.112.210.100 with SMTP id mt4mr10055837lbc.31.1417707541345; Thu, 04 Dec 2014 07:39:01 -0800 (PST) Received: from macmini.lan (84-217-193-77.tn.glocalnet.net. [84.217.193.77]) by mx.google.com with ESMTPSA id zo3sm7411637lbb.10.2014.12.04.07.39.00 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 04 Dec 2014 07:39:00 -0800 (PST) From: Ola Liljedahl To: lng-odp@lists.linaro.org Date: Thu, 4 Dec 2014 16:38:52 +0100 Message-Id: <1417707535-7632-4-git-send-email-ola.liljedahl@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1417707535-7632-1-git-send-email-ola.liljedahl@linaro.org> References: <1417707535-7632-1-git-send-email-ola.liljedahl@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv2 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.47 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 Reviewed-by: Bill Fischofer --- (This code contribution is provided under the terms of agreement LES-LTM-21309) Update and unify doxygen comments and function parameter names. platform/linux-generic/include/api/odp_rwlock.h | 36 ++++++++++++++----------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/platform/linux-generic/include/api/odp_rwlock.h b/platform/linux-generic/include/api/odp_rwlock.h index 59cf9cc..1295e31 100644 --- a/platform/linux-generic/include/api/odp_rwlock.h +++ b/platform/linux-generic/include/api/odp_rwlock.h @@ -19,54 +19,58 @@ 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 rwlock Pointer to a reader/writer lock */ void odp_rwlock_init(odp_rwlock_t *rwlock); /** - * Aquire a read lock. + * Acquire read permission on a reader/writer lock. * - * @param rwlock pointer to a RW Lock. + * @param rwlock Pointer to a reader/writer lock */ void odp_rwlock_read_lock(odp_rwlock_t *rwlock); /** - * Release a read lock. + * Release read permission on a reader/writer lock. * - * @param rwlock pointer to the RW Lock. + * @param rwlock Pointer to a reader/writer lock */ void odp_rwlock_read_unlock(odp_rwlock_t *rwlock); /** - * Aquire a write lock. + * Acquire write permission on a reader/writer lock. * - * @param rwlock pointer to a RW Lock. + * @param rwlock Pointer to a reader/writer lock */ void odp_rwlock_write_lock(odp_rwlock_t *rwlock); /** - * Release a write lock. + * Release write permission on a reader/writer lock. * - * @param rwlock pointer to a RW Lock. + * @param rwlock Pointer to a reader/writer lock */ void odp_rwlock_write_unlock(odp_rwlock_t *rwlock);