lkml.org 
[lkml]   [2005]   [Dec]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/19] MUTEX: Introduce simple mutex implementation
From
Date
On Thu, 2005-12-15 at 08:28 -0800, Linus Torvalds wrote:
> I would suggest that if you create a new "mutex" type, you just keep the
> lower-case name. Don't re-use the DECLARE_MUTEX format, just do
>
> struct mutex my_mutex = UNLOCKED_MUTEX;
>
> for new code that uses the new stuff.
>
> Think about it a bit. We don't have DECLARE_SPINLOCK either. Why?

Well, we have DEFINE_SPINLOCK() and we should have a matching one for
mutexes DEFINE_MUTEX().

The reason is that you can implement complex initialization for
debugging or extensions which can't be done by a var = INITIALZER,
because you dont have a reference to var.

tglx


-
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-12-15 18:06    [W:0.231 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site