summaryrefslogtreecommitdiff
path: root/libthreads
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1996-05-04 09:35:31 +0000
committerRoland McGrath <roland@gnu.org>1996-05-04 09:35:31 +0000
commit998bec3d2c995cc3171401f3e5e8af86e65a3188 (patch)
tree5cd3bce4b935276275802b91a0c36c44beb82542 /libthreads
parent1bbe570f3e867b68676c4aeea191e92eec0ff181 (diff)
Moved to libthreads from libshouldbeinlibc.
(_EXTERN_INLINE): New macro. Use it for all the inline defns.
Diffstat (limited to 'libthreads')
-rw-r--r--libthreads/rwlock.h22
1 files changed, 13 insertions, 9 deletions
diff --git a/libthreads/rwlock.h b/libthreads/rwlock.h
index 4f208424..44c1e0ec 100644
--- a/libthreads/rwlock.h
+++ b/libthreads/rwlock.h
@@ -1,6 +1,6 @@
/* Simple reader/writer locks.
- Copyright (C) 1994, 1995 Free Software Foundation, Inc.
+ Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
@@ -16,8 +16,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-#ifndef _rwlock_h
-#define _rwlock_h
+#ifndef _RWLOCK_H
+#define _RWLOCK_H 1
#include <cthreads.h>
#include <assert.h>
@@ -31,8 +31,12 @@ struct rwlock
int readers_waiting;
};
+#ifndef _EXTERN_INLINE
+#define _EXTERN_INLINE extern __inline
+#endif
+
/* Get a reader lock on reader-writer lock LOCK for disknode DN */
-extern inline void
+_EXTERN_INLINE void
rwlock_reader_lock (struct rwlock *lock)
{
mutex_lock (&lock->master);
@@ -49,7 +53,7 @@ rwlock_reader_lock (struct rwlock *lock)
}
/* Get a writer lock on reader-writer lock LOCK for disknode DN */
-extern inline void
+_EXTERN_INLINE void
rwlock_writer_lock (struct rwlock *lock)
{
mutex_lock (&lock->master);
@@ -66,7 +70,7 @@ rwlock_writer_lock (struct rwlock *lock)
}
/* Release a reader lock on reader-writer lock LOCK for disknode DN */
-extern inline void
+_EXTERN_INLINE void
rwlock_reader_unlock (struct rwlock *lock)
{
mutex_lock (&lock->master);
@@ -78,7 +82,7 @@ rwlock_reader_unlock (struct rwlock *lock)
}
/* Release a writer lock on reader-writer lock LOCK for disknode DN */
-extern inline void
+_EXTERN_INLINE void
rwlock_writer_unlock (struct rwlock *lock)
{
mutex_lock (&lock->master);
@@ -90,7 +94,7 @@ rwlock_writer_unlock (struct rwlock *lock)
}
/* Initialize reader-writer lock LOCK */
-extern inline void
+_EXTERN_INLINE void
rwlock_init (struct rwlock *lock)
{
mutex_init (&lock->master);
@@ -104,4 +108,4 @@ rwlock_init (struct rwlock *lock)
{ MUTEX_INITIALIZER, CONDITION_INITIALIZER, 0, 0, 0 }
-#endif /* _rwlock_h */
+#endif /* rwlock.h */