summaryrefslogtreecommitdiffstats
path: root/lib/libpthread/thread/thr_rwlock.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libpthread/thread/thr_rwlock.c')
-rw-r--r--lib/libpthread/thread/thr_rwlock.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/lib/libpthread/thread/thr_rwlock.c b/lib/libpthread/thread/thr_rwlock.c
index 648e8a3..9c87e44 100644
--- a/lib/libpthread/thread/thr_rwlock.c
+++ b/lib/libpthread/thread/thr_rwlock.c
@@ -26,7 +26,6 @@
* $FreeBSD$
*/
-#ifdef _THREAD_SAFE
#include <errno.h>
#include <limits.h>
#include <stdlib.h>
@@ -37,6 +36,14 @@
/* maximum number of times a read lock may be obtained */
#define MAX_READ_LOCKS (INT_MAX - 1)
+#pragma weak pthread_rwlock_destroy=_pthread_rwlock_destroy
+#pragma weak pthread_rwlock_init=_pthread_rwlock_init
+#pragma weak pthread_rwlock_rdlock=_pthread_rwlock_rdlock
+#pragma weak pthread_rwlock_tryrdlock=_pthread_rwlock_tryrdlock
+#pragma weak pthread_rwlock_trywrlock=_pthread_rwlock_trywrlock
+#pragma weak pthread_rwlock_unlock=_pthread_rwlock_unlock
+#pragma weak pthread_rwlock_wrlock=_pthread_rwlock_wrlock
+
static int init_static (pthread_rwlock_t *rwlock);
static spinlock_t static_init_lock = _SPINLOCK_INITIALIZER;
@@ -59,7 +66,7 @@ init_static (pthread_rwlock_t *rwlock)
}
int
-pthread_rwlock_destroy (pthread_rwlock_t *rwlock)
+_pthread_rwlock_destroy (pthread_rwlock_t *rwlock)
{
int ret;
@@ -84,7 +91,7 @@ pthread_rwlock_destroy (pthread_rwlock_t *rwlock)
}
int
-pthread_rwlock_init (pthread_rwlock_t *rwlock, const pthread_rwlockattr_t *attr)
+_pthread_rwlock_init (pthread_rwlock_t *rwlock, const pthread_rwlockattr_t *attr)
{
pthread_rwlock_t prwlock;
int ret;
@@ -127,7 +134,7 @@ pthread_rwlock_init (pthread_rwlock_t *rwlock, const pthread_rwlockattr_t *attr)
}
int
-pthread_rwlock_rdlock (pthread_rwlock_t *rwlock)
+_pthread_rwlock_rdlock (pthread_rwlock_t *rwlock)
{
pthread_rwlock_t prwlock;
int ret;
@@ -178,7 +185,7 @@ pthread_rwlock_rdlock (pthread_rwlock_t *rwlock)
}
int
-pthread_rwlock_tryrdlock (pthread_rwlock_t *rwlock)
+_pthread_rwlock_tryrdlock (pthread_rwlock_t *rwlock)
{
pthread_rwlock_t prwlock;
int ret;
@@ -215,7 +222,7 @@ pthread_rwlock_tryrdlock (pthread_rwlock_t *rwlock)
}
int
-pthread_rwlock_trywrlock (pthread_rwlock_t *rwlock)
+_pthread_rwlock_trywrlock (pthread_rwlock_t *rwlock)
{
pthread_rwlock_t prwlock;
int ret;
@@ -250,7 +257,7 @@ pthread_rwlock_trywrlock (pthread_rwlock_t *rwlock)
}
int
-pthread_rwlock_unlock (pthread_rwlock_t *rwlock)
+_pthread_rwlock_unlock (pthread_rwlock_t *rwlock)
{
pthread_rwlock_t prwlock;
int ret;
@@ -287,7 +294,7 @@ pthread_rwlock_unlock (pthread_rwlock_t *rwlock)
}
int
-pthread_rwlock_wrlock (pthread_rwlock_t *rwlock)
+_pthread_rwlock_wrlock (pthread_rwlock_t *rwlock)
{
pthread_rwlock_t prwlock;
int ret;
@@ -332,4 +339,3 @@ pthread_rwlock_wrlock (pthread_rwlock_t *rwlock)
return(ret);
}
-#endif /* _THREAD_SAFE */
OpenPOWER on IntegriCloud