Re: [PATCH 1/19] MUTEX: Introduce simple mutex implementation

Paul Jackson
2005-12-15T16:56:02Z

> But what to do about DECLARE_MUTEX? :-/

A phased change of just the renames:
DECLARE_MUTEX ==> DECLARE_SEM
init_MUTEX ==> init_SEM
DECLARE_MUTEX_LOCKED ==> DECLARE_SEM_LOCKED
init_MUTEX_LOCKED ==> init_SEM_LOCKED

seems doable. A scripted replacement, so long as it specifies whole
word replacement only, seems to be a very robust replacement for these
four symbols, unlike "up"/"down", which are scary at best to consider
wholesale replacement.

Add the new *_SEM in one release as aliases for the current *_MUTEX,
do the wholesale replacement of the above names, leaving the old as
aliases in a second release, remove the old *_MUTEX aliases in a third
release, and them restore them as new 'real mutex' methods in a fourth
release. Be sure that the new *_MUTEX versions will generate a compile
error if handed the old counting semaphore type.

I'm a stickler for names ... at least until Linus/Andrew show me
the foolishness of my ways, I could find such a change appealing.

Of course, they're the ones with all the sweat equity on the line,
not me.

... I'd better duck and get back to bug fixing, before I get hit ...

--
I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <pj@sgi.com> 1.925.600.0401