aboutsummaryrefslogtreecommitdiff
path: root/htl
diff options
context:
space:
mode:
Diffstat (limited to 'htl')
-rw-r--r--htl/cthreads-compat.c10
-rw-r--r--htl/pt-alloc.c4
-rw-r--r--htl/pt-cleanup.c3
-rw-r--r--htl/pt-create.c8
-rw-r--r--htl/pt-detach.c5
-rw-r--r--htl/pt-exit.c4
-rw-r--r--htl/pt-testcancel.c3
7 files changed, 21 insertions, 16 deletions
diff --git a/htl/cthreads-compat.c b/htl/cthreads-compat.c
index 7ae013b..6b2db64 100644
--- a/htl/cthreads-compat.c
+++ b/htl/cthreads-compat.c
@@ -26,7 +26,7 @@ __cthread_detach (__cthread_t thread)
{
int err;
- err = pthread_detach ((pthread_t) thread);
+ err = __pthread_detach ((pthread_t) thread);
assert_perror (err);
}
weak_alias (__cthread_detach, cthread_detach)
@@ -37,7 +37,7 @@ __cthread_fork (__cthread_fn_t func, void *arg)
pthread_t thread;
int err;
- err = pthread_create (&thread, NULL, func, arg);
+ err = __pthread_create (&thread, NULL, func, arg);
assert_perror (err);
return (__cthread_t) thread;
@@ -49,7 +49,7 @@ __cthread_keycreate (__cthread_key_t *key)
{
error_t err;
- err = pthread_key_create (key, 0);
+ err = __pthread_key_create (key, 0);
if (err)
{
errno = err;
@@ -64,7 +64,7 @@ weak_alias (__cthread_keycreate, cthread_keycreate)
int
__cthread_getspecific (__cthread_key_t key, void **val)
{
- *val = pthread_getspecific (key);
+ *val = __pthread_getspecific (key);
return 0;
}
weak_alias (__cthread_getspecific, cthread_getspecific)
@@ -74,7 +74,7 @@ __cthread_setspecific (__cthread_key_t key, void *val)
{
error_t err;
- err = pthread_setspecific (key, (const void *) val);
+ err = __pthread_setspecific (key, (const void *) val);
if (err)
{
errno = err;
diff --git a/htl/pt-alloc.c b/htl/pt-alloc.c
index aa3721d..f87829f 100644
--- a/htl/pt-alloc.c
+++ b/htl/pt-alloc.c
@@ -91,7 +91,7 @@ __pthread_alloc (struct __pthread **pthread)
int max_threads;
int new_max_threads;
- pthread_mutex_lock (&__pthread_free_threads_lock);
+ __pthread_mutex_lock (&__pthread_free_threads_lock);
for (new = __pthread_free_threads; new; new = new->next)
{
/* There is no need to take NEW->STATE_LOCK: if NEW is on this
@@ -105,7 +105,7 @@ __pthread_alloc (struct __pthread **pthread)
break;
}
}
- pthread_mutex_unlock (&__pthread_free_threads_lock);
+ __pthread_mutex_unlock (&__pthread_free_threads_lock);
if (new)
{
diff --git a/htl/pt-cleanup.c b/htl/pt-cleanup.c
index 3c2d83a..05c1873 100644
--- a/htl/pt-cleanup.c
+++ b/htl/pt-cleanup.c
@@ -21,7 +21,8 @@
#include <pt-internal.h>
struct __pthread_cancelation_handler **
-__pthread_get_cleanup_stack (void)
+___pthread_get_cleanup_stack (void)
{
return &_pthread_self ()->cancelation_handlers;
}
+strong_alias (___pthread_get_cleanup_stack, __pthread_cleanup_stack)
diff --git a/htl/pt-create.c b/htl/pt-create.c
index 2b53658..a555c2f 100644
--- a/htl/pt-create.c
+++ b/htl/pt-create.c
@@ -26,6 +26,7 @@
#include <hurd/resource.h>
#include <pt-internal.h>
+#include <pthreadP.h>
#if IS_IN (libpthread)
# include <ctype.h>
@@ -58,14 +59,14 @@ entry_point (struct __pthread *self, void *(*start_routine) (void *), void *arg)
__pthread_startup ();
- pthread_exit (start_routine (arg));
+ __pthread_exit (start_routine (arg));
}
/* Create a thread with attributes given by ATTR, executing
START_ROUTINE with argument ARG. */
int
-pthread_create (pthread_t * thread, const pthread_attr_t * attr,
- void *(*start_routine) (void *), void *arg)
+__pthread_create (pthread_t * thread, const pthread_attr_t * attr,
+ void *(*start_routine) (void *), void *arg)
{
int err;
struct __pthread *pthread;
@@ -78,6 +79,7 @@ pthread_create (pthread_t * thread, const pthread_attr_t * attr,
return err;
}
+strong_alias (__pthread_create, pthread_create)
/* Internal version of pthread_create. See comment in
pt-internal.h. */
diff --git a/htl/pt-detach.c b/htl/pt-detach.c
index 25f23ea..40082c5 100644
--- a/htl/pt-detach.c
+++ b/htl/pt-detach.c
@@ -25,7 +25,7 @@
/* Indicate that the storage for THREAD can be reclaimed when it
terminates. */
int
-pthread_detach (pthread_t thread)
+__pthread_detach (pthread_t thread)
{
struct __pthread *pthread;
int err = 0;
@@ -47,7 +47,7 @@ pthread_detach (pthread_t thread)
/* Broadcast the condition. This will make threads that are
waiting to join THREAD continue with hopefully disastrous
consequences instead of blocking indefinitely. */
- pthread_cond_broadcast (&pthread->state_cond);
+ __pthread_cond_broadcast (&pthread->state_cond);
__pthread_mutex_unlock (&pthread->state_lock);
__pthread_dealloc (pthread);
@@ -77,3 +77,4 @@ pthread_detach (pthread_t thread)
return err;
}
+strong_alias (__pthread_detach, pthread_detach)
diff --git a/htl/pt-exit.c b/htl/pt-exit.c
index 6cde558..0815dbc 100644
--- a/htl/pt-exit.c
+++ b/htl/pt-exit.c
@@ -38,14 +38,14 @@ __pthread_exit (void *status)
/* Run any cancelation handlers. According to POSIX, the
cancellation cleanup handlers should be called with cancellation
disabled. */
- pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, &oldstate);
+ __pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, &oldstate);
for (handlers = __pthread_get_cleanup_stack ();
*handlers != NULL;
*handlers = (*handlers)->__next)
(*handlers)->__handler ((*handlers)->__arg);
- pthread_setcancelstate (oldstate, &oldstate);
+ __pthread_setcancelstate (oldstate, &oldstate);
/* Decrease the number of threads. We use an atomic operation to
make sure that only the last thread calls `exit'. */
diff --git a/htl/pt-testcancel.c b/htl/pt-testcancel.c
index b15eb6b..116a307 100644
--- a/htl/pt-testcancel.c
+++ b/htl/pt-testcancel.c
@@ -19,6 +19,7 @@
#include <pthread.h>
#include <pt-internal.h>
+#include <pthreadP.h>
void
pthread_testcancel (void)
@@ -31,5 +32,5 @@ pthread_testcancel (void)
__pthread_mutex_unlock (&p->cancel_lock);
if (cancelled)
- pthread_exit (PTHREAD_CANCELED);
+ __pthread_exit (PTHREAD_CANCELED);
}