lkml.org 
[lkml]   [2005]   [Sep]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH] RT: __MUTEX_INITIALIZER for rt_mutex
From
Date

Add __MUTEX_INITIALIZER macro for rt_mutex types.

Signed-Off-By: Daniel Walker <dwalker@mvista.com>

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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-09-22 01:41    [W:0.027 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site