From patchwork Thu Dec 4 15:38:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ola Liljedahl X-Patchwork-Id: 41944 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C22552486D for ; Thu, 4 Dec 2014 15:39:44 +0000 (UTC) Received: by mail-la0-f72.google.com with SMTP id gq15sf11134890lab.7 for ; Thu, 04 Dec 2014 07:39:43 -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=lmU/XfV7rqo/s4bKCIXLG1N0WrEeWUYlE8ydEKxMdng=; b=ivtp2ywg5WXl1XGtgONNOExjtkWymiHt7bTlfchuYw5BNmpcDMU+D7dL7NJXPPnska cbkWfJM6riYksGoGVGMK5kA/oEFPoQKUmgjxqDL5TmB91DrjuCLRofzJx8JLeFWcYnlB irrLDIrfcEoGja+wGwKyKfpmrMAb6Nw3KQzWlJexUJDBOm2BQMv5Nm9SgZzhfCtH9cnP AjQkB97wHqNjdpEmfSiWOIcNK7uARjiy6yU5GWT8HS/ri2yfvis0sNCCIJlnY0CzCJZg K5WF6bM5KQKOSGDvSp/rlO2FNZfe+reGVtUnvqxnePocMmKzbspEP4RDqyQp63WsSEnz LZSw== X-Gm-Message-State: ALoCoQkkuwp2NPWwZ9gLsoIAfE6CPPGvlAwYYtO2FecxJHlSdzKliJT3x1Sri9yJtkuZrKkyS53g X-Received: by 10.112.53.39 with SMTP id y7mr2384460lbo.8.1417707583878; Thu, 04 Dec 2014 07:39:43 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.204.65 with SMTP id kw1ls298466lac.70.gmail; Thu, 04 Dec 2014 07:39:43 -0800 (PST) X-Received: by 10.112.130.132 with SMTP id oe4mr10109009lbb.82.1417707583727; Thu, 04 Dec 2014 07:39:43 -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 w2si23516417laz.109.2014.12.04.07.39.43 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 04 Dec 2014 07:39:43 -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 q1so9523027lam.5 for ; Thu, 04 Dec 2014 07:39:43 -0800 (PST) X-Received: by 10.152.2.165 with SMTP id 5mr10177431lav.40.1417707583630; Thu, 04 Dec 2014 07:39:43 -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 ew9csp56649lbc; Thu, 4 Dec 2014 07:39:42 -0800 (PST) X-Received: by 10.140.48.1 with SMTP id n1mr17660448qga.12.1417707580602; Thu, 04 Dec 2014 07:39:40 -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 c9si31685796qci.18.2014.12.04.07.39.39 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 04 Dec 2014 07:39:40 -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 1XwYVG-0004Tw-Au; Thu, 04 Dec 2014 15:39:38 +0000 Received: from mail-lb0-f173.google.com ([209.85.217.173]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XwYUm-0004PX-Rn for lng-odp@lists.linaro.org; Thu, 04 Dec 2014 15:39:08 +0000 Received: by mail-lb0-f173.google.com with SMTP id z12so14150745lbi.32 for ; Thu, 04 Dec 2014 07:39:03 -0800 (PST) X-Received: by 10.112.27.133 with SMTP id t5mr10066406lbg.45.1417707543307; Thu, 04 Dec 2014 07:39:03 -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.02 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 04 Dec 2014 07:39:02 -0800 (PST) From: Ola Liljedahl To: lng-odp@lists.linaro.org Date: Thu, 4 Dec 2014 16:38:54 +0100 Message-Id: <1417707535-7632-6-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 5/6] api:odp_ticketlock.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 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. .../linux-generic/include/api/odp_ticketlock.h | 45 ++++++++++++---------- 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/platform/linux-generic/include/api/odp_ticketlock.h b/platform/linux-generic/include/api/odp_ticketlock.h index 619816e..93a66b7 100644 --- a/platform/linux-generic/include/api/odp_ticketlock.h +++ b/platform/linux-generic/include/api/odp_ticketlock.h @@ -23,11 +23,16 @@ extern "C" { #include /** @addtogroup odp_synchronizers + * Operations on ticket locks. + * Acquiring a ticket lock happens in two phases. First the threads takes a + * ticket. Second it waits (spins) until it is its turn. + * Ticket locks are believed to be more fair than spin locks. + * Ticket locks shall not be used in the presence of preemption. * @{ */ /** - * ODP ticketlock + * ODP ticket lock */ typedef struct odp_ticketlock_t { odp_atomic_u32_t next_ticket; /**< @private Next ticket */ @@ -36,47 +41,47 @@ typedef struct odp_ticketlock_t { /** - * Init ticketlock + * Initialize ticket lock. * - * @param ticketlock Ticketlock + * @param tklock Pointer to a ticket lock */ -void odp_ticketlock_init(odp_ticketlock_t *ticketlock); +void odp_ticketlock_init(odp_ticketlock_t *tklock); /** - * Lock ticketlock + * Acquire ticket lock. * - * @param ticketlock Ticketlock + * @param tklock Pointer to a ticket lock */ -void odp_ticketlock_lock(odp_ticketlock_t *ticketlock); - +void odp_ticketlock_lock(odp_ticketlock_t *tklock); /** - * Try to lock ticketlock + * Try to acquire ticket lock. * - * @param ticketlock Ticketlock + * @param tklock Pointer to a ticket lock * - * @return 1 if the lock was taken, otherwise 0. + * @retval 1 lock acquired + * @retval 0 lock not acquired */ -int odp_ticketlock_trylock(odp_ticketlock_t *ticketlock); - +int odp_ticketlock_trylock(odp_ticketlock_t *tklock); /** - * Unlock ticketlock + * Release ticket lock. * - * @param ticketlock Ticketlock + * @param tklock Pointer to a ticket lock */ -void odp_ticketlock_unlock(odp_ticketlock_t *ticketlock); +void odp_ticketlock_unlock(odp_ticketlock_t *tklock); /** - * Test if ticketlock is locked + * Check if ticket lock is locked. * - * @param ticketlock Ticketlock + * @param tklock Pointer to a ticket lock * - * @return 1 if the lock is locked, otherwise 0. + * @retval 1 the lock is busy (locked) + * @retval 0 the lock is available (unlocked) */ -int odp_ticketlock_is_locked(odp_ticketlock_t *ticketlock); +int odp_ticketlock_is_locked(odp_ticketlock_t *tklock); /** * @}