[PATCH] RT: __MUTEX_INITIALIZER for rt_mutex

From: Daniel Walker
Date: Wed Sep 21 2005 - 18:39:33 EST



Add __MUTEX_INITIALIZER macro for rt_mutex types.

Signed-Off-By: Daniel Walker <dwalker@xxxxxxxxxx>

Index: linux-2.6.13/include/linux/rt_lock.h
===================================================================
--- linux-2.6.13.orig/include/linux/rt_lock.h
+++ 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


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/