From patchwork Wed Dec 3 14:17:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ola Liljedahl X-Patchwork-Id: 41846 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 814C925E88 for ; Wed, 3 Dec 2014 14:18:26 +0000 (UTC) Received: by mail-wi0-f197.google.com with SMTP id l15sf9774455wiw.8 for ; Wed, 03 Dec 2014 06:18:24 -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=NzkMMtwa5Q9hIeiyPAn0WF84KjS6PJ2Kvy8yOLWohXE=; b=kwz80GrVyEP5wHYmeanWN5tfIFqQ9LHxjRsllleW4luqOso0T0KAzvaPA3Zjg3kv1P BvODwwp9Wz/HYFJf5xGHvc2UmX7RV0GIZK6QjQfpkkKTcrQEAnAe5eLra0s2dXx4RdfX N/PPNPxyJCc3n0+MAvAEh1p6O/u2305xhXUOmWg6vnt1ZlKzVIqRNoZJm+nacmZLBSm0 ac/3QzXxzJNlS8SfXPJy74c5hnGOH0iIA3qdpiq4zTyIUqnt0raMYHavkz0y+hLN1kIf wADFQUjky3sez5CzCsQ+SdWSQwuosdgdr26yd97N+fV/cfSf4FXxzyhFGUHqZseQLHIT w/SA== X-Gm-Message-State: ALoCoQkykcC3eYSLzlQrLAaxgRX7tP0mlYOLnareUNSierzfJHCbsSMTb7wqQiM5+eFjVmVHM6CM X-Received: by 10.180.102.228 with SMTP id fr4mr16421439wib.1.1417616304872; Wed, 03 Dec 2014 06:18:24 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.29.5 with SMTP id f5ls161315lah.62.gmail; Wed, 03 Dec 2014 06:18:24 -0800 (PST) X-Received: by 10.112.173.39 with SMTP id bh7mr4541728lbc.53.1417616304705; Wed, 03 Dec 2014 06:18:24 -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 kz8si5618780lab.13.2014.12.03.06.18.24 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Dec 2014 06:18:24 -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 gq15so12737850lab.18 for ; Wed, 03 Dec 2014 06:18:24 -0800 (PST) X-Received: by 10.112.235.196 with SMTP id uo4mr4454139lbc.66.1417616304604; Wed, 03 Dec 2014 06:18:24 -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 ew9csp672018lbc; Wed, 3 Dec 2014 06:18:23 -0800 (PST) X-Received: by 10.236.32.10 with SMTP id n10mr6003139yha.116.1417616301807; Wed, 03 Dec 2014 06:18:21 -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 j31si27974930qgf.85.2014.12.03.06.18.21 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 03 Dec 2014 06:18:21 -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 1XwAl1-0003Lh-98; Wed, 03 Dec 2014 14:18:19 +0000 Received: from mail-la0-f46.google.com ([209.85.215.46]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XwAkY-0003Cx-1I for lng-odp@lists.linaro.org; Wed, 03 Dec 2014 14:17:50 +0000 Received: by mail-la0-f46.google.com with SMTP id q1so7792172lam.33 for ; Wed, 03 Dec 2014 06:17:44 -0800 (PST) X-Received: by 10.152.42.198 with SMTP id q6mr4486253lal.48.1417616264070; Wed, 03 Dec 2014 06:17:44 -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.43 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 03 Dec 2014 06:17:43 -0800 (PST) From: Ola Liljedahl To: lng-odp@lists.linaro.org Date: Wed, 3 Dec 2014 15:17:33 +0100 Message-Id: <1417616254-31760-6-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 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.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: Ola Liljedahl --- Update doxygen comments, renaming of function params. .../linux-generic/include/api/odp_ticketlock.h | 43 ++++++++++------------ 1 file changed, 19 insertions(+), 24 deletions(-) diff --git a/platform/linux-generic/include/api/odp_ticketlock.h b/platform/linux-generic/include/api/odp_ticketlock.h index 619816e..39a0187 100644 --- a/platform/linux-generic/include/api/odp_ticketlock.h +++ b/platform/linux-generic/include/api/odp_ticketlock.h @@ -23,11 +23,15 @@ 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. * @{ */ /** - * ODP ticketlock + * ODP ticket lock */ typedef struct odp_ticketlock_t { odp_atomic_u32_t next_ticket; /**< @private Next ticket */ @@ -36,47 +40,38 @@ typedef struct odp_ticketlock_t { /** - * Init ticketlock + * Initialize ticket lock. * - * @param ticketlock Ticketlock + * @param[out] p_tklck Pointer to ticket lock */ -void odp_ticketlock_init(odp_ticketlock_t *ticketlock); +void odp_ticketlock_init(odp_ticketlock_t *p_tklck); /** - * Lock ticketlock - * - * @param ticketlock Ticketlock - */ -void odp_ticketlock_lock(odp_ticketlock_t *ticketlock); - - -/** - * Try to lock ticketlock - * - * @param ticketlock Ticketlock + * Acquire ticket lock. * - * @return 1 if the lock was taken, otherwise 0. + * @param[in,out] p_tklck Pointer to ticket lock */ -int odp_ticketlock_trylock(odp_ticketlock_t *ticketlock); +void odp_ticketlock_lock(odp_ticketlock_t *p_tklck); /** - * Unlock ticketlock + * Release ticket lock. * - * @param ticketlock Ticketlock + * @param[in,out] p_tklck Pointer to ticket lock */ -void odp_ticketlock_unlock(odp_ticketlock_t *ticketlock); +void odp_ticketlock_unlock(odp_ticketlock_t *p_tklck); /** - * Test if ticketlock is locked + * Check if ticket lock is locked. * - * @param ticketlock Ticketlock + * @param[in] p_tklck Pointer to 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 *p_tklck); /** * @}