public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Matti Linnanvuori <mattilinnanvuori@yahoo.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] include/linux/mutex.h: unclear reference to convention
Date: Sat, 22 Sep 2007 01:41:17 -0700 (PDT)	[thread overview]
Message-ID: <664979.77080.qm@web52001.mail.re2.yahoo.com> (raw)

From: Matti Linnanvuori <mattilinnanvuori@yahoo.com>

Reference to two different conventions is unnecessarily unclear unless you know them already and requires seeking and reading another file for understanding.

Signed-off-by: Matti Linnanvuori <mattilinnanvuori@yahoo.com>
---

--- linux-2.6.23-rc7/include/linux/mutex.h    2007-09-22 11:09:42.223763000 +0300
+++ linux-2.6.23/include/linux/mutex.h    2007-09-22 11:11:19.416761000 +0300
@@ -132,9 +132,19 @@ extern int __must_check mutex_lock_inter
 # define mutex_lock_interruptible_nested(lock, subclass) mutex_lock_interruptible(lock)
 #endif
 
-/*
- * NOTE: mutex_trylock() follows the spin_trylock() convention,
- *       not the down_trylock() convention!
+/***
+ * mutex_trylock - try acquire the mutex, without waiting
+ * @lock: the mutex to be acquired
+ *
+ * Try to acquire the mutex atomically. Returns 1 if the mutex
+ * has been acquired successfully, and 0 on contention.
+ *
+ * NOTE: this function follows the spin_trylock() convention, so
+ * it is negated to the down_trylock() return values! Be careful
+ * about this when converting semaphore users to mutexes.
+ *
+ * This function must not be used in interrupt context. The
+ * mutex must be released by the same task that acquired it.
  */
 extern int fastcall mutex_trylock(struct mutex *lock);
 extern void fastcall mutex_unlock(struct mutex *lock);





      ________ 
Yahoo! Clever: Stellen Sie Fragen und finden Sie Antworten. Teilen Sie Ihr Wissen. www.yahoo.de/clever


             reply	other threads:[~2007-09-22  8:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-22  8:41 Matti Linnanvuori [this message]
2007-09-22 17:35 ` [PATCH] include/linux/mutex.h: unclear reference to convention Randy Dunlap
  -- strict thread matches above, loose matches on Subject: below --
2007-09-24  7:38 Matti Linnanvuori
2007-09-24 14:49 ` Randy Dunlap
2007-09-25  8:11 Matti Linnanvuori
2007-09-25 15:33 ` Randy Dunlap

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=664979.77080.qm@web52001.mail.re2.yahoo.com \
    --to=mattilinnanvuori@yahoo.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox