linux-cvs-patches
[Top] [All Lists]

CVS Update@linux-mips.org: linux

To: linux-cvs-patches@linux-mips.org
Subject: CVS Update@linux-mips.org: linux
From: ralf@linux-mips.org
Date: Thu, 03 Feb 2005 13:34:51 +0000
Reply-to: linux-mips@linux-mips.org
Sender: linux-cvs-patches-bounce@linux-mips.org
CVSROOT:        /home/cvs
Module name:    linux
Changes by:     ralf@ftp.linux-mips.org 05/02/03 13:34:45

Modified files:
        include/asm-mips: spinlock.h 

Log message:
        Define read_can_lock / write_can_lock.

diff -urN linux/include/asm-mips/spinlock.h linux/include/asm-mips/spinlock.h
--- linux/include/asm-mips/spinlock.h   2005/01/25 04:28:54     1.29
+++ linux/include/asm-mips/spinlock.h   2005/02/03 13:34:45     1.30
@@ -140,6 +140,18 @@
 
 #define rwlock_init(x)  do { *(x) = RW_LOCK_UNLOCKED; } while(0)
 
+/*
+ * read_can_lock - would read_trylock() succeed?
+ * @lock: the rwlock in question.
+ */
+#define read_can_lock(rw)      ((rw)->lock >= 0)
+
+/*
+ * write_can_lock - would write_trylock() succeed?
+ * @lock: the rwlock in question.
+ */
+#define write_can_lock(rw)     (!(rw)->lock)
+
 static inline void _raw_read_lock(rwlock_t *rw)
 {
        unsigned int tmp;

<Prev in Thread] Current Thread [Next in Thread>