diff mbox series

[hurd,commited] htl: Add internal versions of functions used by C11 threads

Message ID 20200112235221.687231-1-samuel.thibault@ens-lyon.org
State New
Headers show
Series [hurd,commited] htl: Add internal versions of functions used by C11 threads | expand

Commit Message

Samuel Thibault Jan. 12, 2020, 11:52 p.m. UTC
The C11 threads implementation needs to call pthread_join and
pthread_key_delete without exposing them.
---
 htl/pt-join.c               | 3 ++-
 sysdeps/htl/libc-lockP.h    | 2 ++
 sysdeps/htl/pt-key-delete.c | 3 ++-
 sysdeps/htl/pthreadP.h      | 1 +
 4 files changed, 7 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/htl/pt-join.c b/htl/pt-join.c
index 158c328af1..b141c4c8b9 100644
--- a/htl/pt-join.c
+++ b/htl/pt-join.c
@@ -27,7 +27,7 @@ 
 /* Make calling thread wait for termination of thread THREAD.  Return
    the exit status of the thread in *STATUS.  */
 int
-pthread_join (pthread_t thread, void **status)
+__pthread_join (pthread_t thread, void **status)
 {
   struct __pthread *pthread;
   int err = 0;
@@ -75,3 +75,4 @@  pthread_join (pthread_t thread, void **status)
 
   return err;
 }
+strong_alias (__pthread_join, pthread_join);
diff --git a/sysdeps/htl/libc-lockP.h b/sysdeps/htl/libc-lockP.h
index 4b035021c9..4ba3930a13 100644
--- a/sysdeps/htl/libc-lockP.h
+++ b/sysdeps/htl/libc-lockP.h
@@ -112,6 +112,8 @@  extern int __pthread_rwlock_unlock (pthread_rwlock_t *__rwlock);
 extern int __pthread_key_create (pthread_key_t *__key,
 				 void (*__destr_function) (void *));
 
+extern int __pthread_key_delete (pthread_key_t __key);
+
 extern int __pthread_setspecific (pthread_key_t __key,
 				  const void *__pointer);
 
diff --git a/sysdeps/htl/pt-key-delete.c b/sysdeps/htl/pt-key-delete.c
index 9b3fd9078d..2f8aae16a5 100644
--- a/sysdeps/htl/pt-key-delete.c
+++ b/sysdeps/htl/pt-key-delete.c
@@ -21,7 +21,7 @@ 
 #include <pt-internal.h>
 
 int
-pthread_key_delete (pthread_key_t key)
+__pthread_key_delete (pthread_key_t key)
 {
   error_t err = 0;
 
@@ -61,3 +61,4 @@  pthread_key_delete (pthread_key_t key)
 
   return err;
 }
+strong_alias (__pthread_key_delete, pthread_key_delete)
diff --git a/sysdeps/htl/pthreadP.h b/sysdeps/htl/pthreadP.h
index 47fd3af87a..30e074c1d0 100644
--- a/sysdeps/htl/pthreadP.h
+++ b/sysdeps/htl/pthreadP.h
@@ -45,6 +45,7 @@  int __pthread_create (pthread_t *newthread,
 void __cthread_detach (__cthread_t);
 int __pthread_detach (pthread_t __threadp);
 void __pthread_exit (void *value) __attribute__ ((__noreturn__));
+int __pthread_join (pthread_t, void **);
 int __cthread_keycreate (__cthread_key_t *);
 int __cthread_getspecific (__cthread_key_t, void **);
 int __cthread_setspecific (__cthread_key_t, void *);