summaryrefslogtreecommitdiff
path: root/libthreads
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2012-03-26 23:44:53 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2012-03-26 23:44:53 +0200
commit511eff7bf616a313e6fc2397db718a81e93847cc (patch)
treebc8c7d40221e4f0d728e2c5b3eb0a9802b99d95f /libthreads
parentd4b231dd9f874076c62f35590a9f6b93ca6481d7 (diff)
parent69056411a354300a17d1e92027435c988508655d (diff)
Merge branch 'master' of git.savannah.gnu.org:/srv/git/hurd/hurd
Diffstat (limited to 'libthreads')
-rw-r--r--libthreads/rwlock.c2
-rw-r--r--libthreads/rwlock.h23
2 files changed, 21 insertions, 4 deletions
diff --git a/libthreads/rwlock.c b/libthreads/rwlock.c
index 93533a97..ae6a7c48 100644
--- a/libthreads/rwlock.c
+++ b/libthreads/rwlock.c
@@ -1,2 +1,2 @@
-#define RWLOCK_EI
+#define RWLOCK_DEFINE_EI
#include "rwlock.h"
diff --git a/libthreads/rwlock.h b/libthreads/rwlock.h
index 1a61eeea..44d9a35d 100644
--- a/libthreads/rwlock.h
+++ b/libthreads/rwlock.h
@@ -21,6 +21,13 @@
#include <cthreads.h>
#include <assert.h>
+#include <features.h>
+
+#ifdef RWLOCK_DEFINE_EI
+#define RWLOCK_EI
+#else
+#define RWLOCK_EI __extern_inline
+#endif
struct rwlock
{
@@ -31,9 +38,17 @@ struct rwlock
int readers_waiting;
};
-#ifndef RWLOCK_EI
-#define RWLOCK_EI extern inline
-#endif
+extern void rwlock_reader_lock (struct rwlock *lock);
+
+extern void rwlock_writer_lock (struct rwlock *lock);
+
+extern void rwlock_reader_unlock (struct rwlock *lock);
+
+extern void rwlock_writer_unlock (struct rwlock *lock);
+
+extern void rwlock_init (struct rwlock *lock);
+
+#if defined(__USE_EXTERN_INLINES) || defined(RWLOCK_DEFINE_EI)
/* Get a reader lock on reader-writer lock LOCK for disknode DN */
RWLOCK_EI void
@@ -104,6 +119,8 @@ rwlock_init (struct rwlock *lock)
lock->writers_waiting = 0;
}
+#endif /* Use extern inlines. */
+
#define RWLOCK_INITIALIZER \
{ MUTEX_INITIALIZER, CONDITION_INITIALIZER, 0, 0, 0 }