summaryrefslogtreecommitdiffstats
path: root/include/linux/semaphore.h
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2010-09-07 14:46:37 +0200
committerThomas Gleixner <tglx@linutronix.de>2010-09-08 15:04:10 +0200
commitfebc88c5948f81114f64c3412011d695aecae233 (patch)
tree8b3c9568f528b048ff61fc042f8e8b6f466c40bb /include/linux/semaphore.h
parentd56557af19867edb8c0e96f8e26399698a08857f (diff)
downloadtalos-op-linux-febc88c5948f81114f64c3412011d695aecae233.tar.gz
talos-op-linux-febc88c5948f81114f64c3412011d695aecae233.zip
semaphore: Add DEFINE_SEMAPHORE
The full cleanup of init_MUTEX[_LOCKED] and DECLARE_MUTEX has not been done. Some of the users are real semaphores and we should name them as such instead of confusing everyone with "MUTEX". Provide the infrastructure to get finally rid of init_MUTEX[_LOCKED] and DECLARE_MUTEX. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Christoph Hellwig <hch@infradead.org> LKML-Reference: <20100907125054.795929962@linutronix.de>
Diffstat (limited to 'include/linux/semaphore.h')
-rw-r--r--include/linux/semaphore.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/semaphore.h b/include/linux/semaphore.h
index 7415839ac890..5310d27abd2a 100644
--- a/include/linux/semaphore.h
+++ b/include/linux/semaphore.h
@@ -26,6 +26,9 @@ struct semaphore {
.wait_list = LIST_HEAD_INIT((name).wait_list), \
}
+#define DEFINE_SEMAPHORE(name) \
+ struct semaphore name = __SEMAPHORE_INITIALIZER(name, 1)
+
#define DECLARE_MUTEX(name) \
struct semaphore name = __SEMAPHORE_INITIALIZER(name, 1)
OpenPOWER on IntegriCloud