spinlocks

Ulrich Drepper drepper@redhat.com
Wed Apr 25 23:38:00 GMT 2001


willy@ldl.fc.hp.com (Matthew Wilcox) writes:

> Since I haven't tested it on other architectures, I have surely missed
> something.  I'm not asking for this to be applied, I'm just asking for
> comment on whether this is an acceptable approach to the problem.

Well, the patch isn't too bad.  There are a few things you'll have to
change:

- the name _lt_spinlock_t isn't good.  We already have too many spinlocks.
  I'd suggest rather something in the line of __lock_object_t or so (better
  proposals are welcome).  The initializer will have to be renamed
  appropriately.

- I would not want the $NEWTYPE to be a struct for architectures which
  don't have to do this.

- related, the definition of __libc_lock_define_initialized etc must be
  optimized for everything != hppa just as before.  This probably means
  introducing another macro stating that the initializer is null.

- the return type for your test() function must be int not long int.
  And while we're at it, this name is also not very good.  test is a far
  too common identifier.


I think that's it.

-- 
---------------.                          ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Red Hat          `--' drepper at redhat.com   `------------------------



More information about the Libc-alpha mailing list