summaryrefslogtreecommitdiff
path: root/pthread
diff options
context:
space:
mode:
Diffstat (limited to 'pthread')
-rw-r--r--pthread/cthreads-compat.c25
-rw-r--r--pthread/pt-getattr.c3
-rw-r--r--pthread/pt-spin-inlines.c5
3 files changed, 17 insertions, 16 deletions
diff --git a/pthread/cthreads-compat.c b/pthread/cthreads-compat.c
index 1a0971b..cd845ed 100644
--- a/pthread/cthreads-compat.c
+++ b/pthread/cthreads-compat.c
@@ -20,23 +20,20 @@
#include <assert.h>
#include <pthread.h>
-typedef void *cthread_t;
-typedef void *(*cthread_fn_t) (void *arg);
-typedef int cthread_key_t;
-
-#define CTHREAD_KEY_INVALID (cthread_key_t) -1
+#define CTHREAD_KEY_INVALID (__cthread_key_t) -1
void
-cthread_detach (cthread_t thread)
+__cthread_detach (__cthread_t thread)
{
int err;
err = pthread_detach ((pthread_t) thread);
assert_perror (err);
}
+weak_alias (__cthread_detach, cthread_detach)
-cthread_t
-cthread_fork (cthread_fn_t func, void *arg)
+__cthread_t
+__cthread_fork (__cthread_fn_t func, void *arg)
{
pthread_t thread;
int err;
@@ -44,11 +41,12 @@ cthread_fork (cthread_fn_t func, void *arg)
err = pthread_create (&thread, NULL, func, arg);
assert_perror (err);
- return (cthread_t) thread;
+ return (__cthread_t) thread;
}
+weak_alias (__cthread_fork, cthread_fork)
int
-cthread_keycreate (cthread_key_t *key)
+__cthread_keycreate (__cthread_key_t *key)
{
error_t err;
@@ -62,16 +60,18 @@ cthread_keycreate (cthread_key_t *key)
return err;
}
+weak_alias (__cthread_keycreate, cthread_keycreate)
int
-cthread_getspecific (cthread_key_t key, void **val)
+__cthread_getspecific (__cthread_key_t key, void **val)
{
*val = pthread_getspecific (key);
return 0;
}
+weak_alias (__cthread_getspecific, cthread_getspecific)
int
-cthread_setspecific (cthread_key_t key, void *val)
+__cthread_setspecific (__cthread_key_t key, void *val)
{
error_t err;
@@ -84,6 +84,7 @@ cthread_setspecific (cthread_key_t key, void *val)
return err;
}
+weak_alias (__cthread_setspecific, cthread_setspecific)
void
__mutex_lock_solid (void *lock)
diff --git a/pthread/pt-getattr.c b/pthread/pt-getattr.c
index 574420a..0b86c66 100644
--- a/pthread/pt-getattr.c
+++ b/pthread/pt-getattr.c
@@ -27,7 +27,7 @@
already running thread THREAD. It shall be called on an uninitialized ATTR
and destroyed with pthread_attr_destroy when no longer needed. */
int
-pthread_getattr_np (pthread_t thread, pthread_attr_t *attr)
+__pthread_getattr_np (pthread_t thread, pthread_attr_t *attr)
{
struct __pthread *pthread;
@@ -49,3 +49,4 @@ pthread_getattr_np (pthread_t thread, pthread_attr_t *attr)
return 0;
}
+weak_alias (__pthread_getattr_np, pthread_getattr_np)
diff --git a/pthread/pt-spin-inlines.c b/pthread/pt-spin-inlines.c
index cfb21dd..97afb4d 100644
--- a/pthread/pt-spin-inlines.c
+++ b/pthread/pt-spin-inlines.c
@@ -25,10 +25,9 @@
#include <pthread.h>
-/* Weak aliases for the spin lock functions. Note that
- pthread_spin_lock is left out deliberately. We already provide an
- implementation for it in pt-spin.c. */
+/* Weak aliases for the spin lock functions. */
weak_alias (__pthread_spin_destroy, pthread_spin_destroy);
weak_alias (__pthread_spin_init, pthread_spin_init);
weak_alias (__pthread_spin_trylock, pthread_spin_trylock);
+weak_alias (__pthread_spin_lock, pthread_spin_lock);
weak_alias (__pthread_spin_unlock, pthread_spin_unlock);