diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2020-01-13 19:58:28 +0000 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2020-02-09 13:56:48 +0100 |
commit | b05de1040009d0d07a5a2e2765cffe554ffbe6ac (patch) | |
tree | 2b112a97ce7947699fac8b6df47e6db0b5196ded /sysdeps/mach | |
parent | 6cefe985b869e7b33b05ce7252410474d8a6c3ad (diff) | |
download | glibc-b05de1040009d0d07a5a2e2765cffe554ffbe6ac.tar glibc-b05de1040009d0d07a5a2e2765cffe554ffbe6ac.tar.gz glibc-b05de1040009d0d07a5a2e2765cffe554ffbe6ac.tar.bz2 glibc-b05de1040009d0d07a5a2e2765cffe554ffbe6ac.zip |
C11 threads: Move implementation to sysdeps/pthread
so it gets shared by nptl and htl. Also add htl versions of thrd_current and
thrd_yield.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Diffstat (limited to 'sysdeps/mach')
-rw-r--r-- | sysdeps/mach/htl/thrd_yield.c | 26 | ||||
-rw-r--r-- | sysdeps/mach/hurd/htl/pt-mutex-destroy.c | 1 | ||||
-rw-r--r-- | sysdeps/mach/hurd/htl/pt-mutex-timedlock.c | 1 | ||||
-rw-r--r-- | sysdeps/mach/hurd/i386/libc.abilist | 4 | ||||
-rw-r--r-- | sysdeps/mach/hurd/i386/libpthread.abilist | 21 |
5 files changed, 53 insertions, 0 deletions
diff --git a/sysdeps/mach/htl/thrd_yield.c b/sysdeps/mach/htl/thrd_yield.c new file mode 100644 index 0000000000..48e17e1c0a --- /dev/null +++ b/sysdeps/mach/htl/thrd_yield.c @@ -0,0 +1,26 @@ +/* sched_yield -- yield the processor. Mach version. + Copyright (C) 2020 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <https://www.gnu.org/licenses/>. */ + +#include <mach.h> +#include "thrd_priv.h" + +void +thrd_yield (void) +{ + (void) __swtch (); +} diff --git a/sysdeps/mach/hurd/htl/pt-mutex-destroy.c b/sysdeps/mach/hurd/htl/pt-mutex-destroy.c index a8a0adc03f..a5bfaddcb2 100644 --- a/sysdeps/mach/hurd/htl/pt-mutex-destroy.c +++ b/sysdeps/mach/hurd/htl/pt-mutex-destroy.c @@ -35,3 +35,4 @@ __pthread_mutex_destroy (pthread_mutex_t *mtxp) } strong_alias (__pthread_mutex_destroy, pthread_mutex_destroy) +hidden_def (__pthread_mutex_destroy) diff --git a/sysdeps/mach/hurd/htl/pt-mutex-timedlock.c b/sysdeps/mach/hurd/htl/pt-mutex-timedlock.c index e83bc57875..3aa7d798b2 100644 --- a/sysdeps/mach/hurd/htl/pt-mutex-timedlock.c +++ b/sysdeps/mach/hurd/htl/pt-mutex-timedlock.c @@ -77,3 +77,4 @@ __pthread_mutex_timedlock (pthread_mutex_t *mtxp, const struct timespec *tsp) return ret; } strong_alias (__pthread_mutex_timedlock, pthread_mutex_timedlock) +hidden_def (__pthread_mutex_timedlock) diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist index 7c2cb2b05a..dd0d3c7317 100644 --- a/sysdeps/mach/hurd/i386/libc.abilist +++ b/sysdeps/mach/hurd/i386/libc.abilist @@ -2181,6 +2181,10 @@ GLIBC_2.3.4 setsourcefilter F GLIBC_2.3.4 xdr_quad_t F GLIBC_2.3.4 xdr_u_quad_t F GLIBC_2.30 twalk_r F +GLIBC_2.32 thrd_current F +GLIBC_2.32 thrd_equal F +GLIBC_2.32 thrd_sleep F +GLIBC_2.32 thrd_yield F GLIBC_2.4 __confstr_chk F GLIBC_2.4 __fgets_chk F GLIBC_2.4 __fgets_unlocked_chk F diff --git a/sysdeps/mach/hurd/i386/libpthread.abilist b/sysdeps/mach/hurd/i386/libpthread.abilist index 14ef22e3db..4a5e1fb750 100644 --- a/sysdeps/mach/hurd/i386/libpthread.abilist +++ b/sysdeps/mach/hurd/i386/libpthread.abilist @@ -142,3 +142,24 @@ GLIBC_2.2.6 __errno_location F GLIBC_2.2.6 __h_errno_location F GLIBC_2.21 pthread_hurd_cond_timedwait_np F GLIBC_2.21 pthread_hurd_cond_wait_np F +GLIBC_2.32 call_once F +GLIBC_2.32 cnd_broadcast F +GLIBC_2.32 cnd_destroy F +GLIBC_2.32 cnd_init F +GLIBC_2.32 cnd_signal F +GLIBC_2.32 cnd_timedwait F +GLIBC_2.32 cnd_wait F +GLIBC_2.32 mtx_destroy F +GLIBC_2.32 mtx_init F +GLIBC_2.32 mtx_lock F +GLIBC_2.32 mtx_timedlock F +GLIBC_2.32 mtx_trylock F +GLIBC_2.32 mtx_unlock F +GLIBC_2.32 thrd_create F +GLIBC_2.32 thrd_detach F +GLIBC_2.32 thrd_exit F +GLIBC_2.32 thrd_join F +GLIBC_2.32 tss_create F +GLIBC_2.32 tss_delete F +GLIBC_2.32 tss_get F +GLIBC_2.32 tss_set F |