Skip to contentSkip to conversation

RT: __MUTEX_INITIALIZER for rt_mutex

PATCH New Daniel Walker 1 participant 1 message Sep 21, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 RT: __MUTEX_INITIALIZER for rt_mutex

Add __MUTEX_INITIALIZER macro for rt_mutex types.

include/linux/rt_lock.h +4 -2
Index: linux-2.6.13/include/linux/rt_lock.h
===================================================================
@@ -229,10 +229,12 @@ struct semaphore {
 	struct rt_mutex lock;
 };
 
-#define DECLARE_MUTEX(name) \
-struct semaphore name = \
+#define __MUTEX_INITIALIZER(name) \
 	{ .count = { 1 }, .lock = __RT_MUTEX_INITIALIZER(name.lock) }
 
+#define DECLARE_MUTEX(name) \
+struct semaphore name = __MUTEX_INITIALIZER(name)
+
 /*
  * DECLARE_MUTEX_LOCKED() is deprecated: very hard to initialize properly
  * and it also often signals abuse of semaphores. So we redirect it to