* [hurd,commited] htl: Add internal version of __pthread_mutex_timedlock
@ 2020-01-13 19:42 Samuel Thibault
0 siblings, 0 replies; 2+ messages in thread
From: Samuel Thibault @ 2020-01-13 19:42 UTC (permalink / raw)
To: libc-alpha; +Cc: Samuel Thibault, commit-hurd
The C11 threads implementation will need it.
---
htl/Versions | 1 +
sysdeps/htl/pt-mutex-timedlock.c | 3 ++-
sysdeps/htl/pthreadP.h | 2 ++
sysdeps/mach/hurd/htl/pt-mutex-timedlock.c | 3 ++-
4 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/htl/Versions b/htl/Versions
index 1c306acf5c..77f7335b9c 100644
--- a/htl/Versions
+++ b/htl/Versions
@@ -155,5 +155,6 @@ libpthread {
__pthread_setspecific;
__pthread_getattr_np;
__pthread_attr_getstack;
+ __pthread_mutex_timedlock;
}
}
diff --git a/sysdeps/htl/pt-mutex-timedlock.c b/sysdeps/htl/pt-mutex-timedlock.c
index d0ebb2975e..0e50f38ef2 100644
--- a/sysdeps/htl/pt-mutex-timedlock.c
+++ b/sysdeps/htl/pt-mutex-timedlock.c
@@ -189,8 +189,9 @@ __pthread_mutex_timedlock_internal (struct __pthread_mutex *mutex,
}
int
-pthread_mutex_timedlock (struct __pthread_mutex *mutex,
+__pthread_mutex_timedlock (struct __pthread_mutex *mutex,
const struct timespec *abstime)
{
return __pthread_mutex_timedlock_internal (mutex, abstime);
}
+strong_alias (__pthread_mutex_timedlock, pthread_mutex_timedlock)
diff --git a/sysdeps/htl/pthreadP.h b/sysdeps/htl/pthreadP.h
index af0154538a..affe7cdf53 100644
--- a/sysdeps/htl/pthreadP.h
+++ b/sysdeps/htl/pthreadP.h
@@ -29,6 +29,8 @@ extern struct __pthread **__pthread_threads;
extern int _pthread_mutex_init (pthread_mutex_t *mutex, const pthread_mutexattr_t *attr);
extern int __pthread_mutex_lock (pthread_mutex_t *__mutex);
+extern int __pthread_mutex_timedlock (pthread_mutex_t *__mutex,
+ const struct timespec *__abstime);
extern int __pthread_mutex_unlock (pthread_mutex_t *__mutex);
extern int __pthread_cond_broadcast (pthread_cond_t *cond);
diff --git a/sysdeps/mach/hurd/htl/pt-mutex-timedlock.c b/sysdeps/mach/hurd/htl/pt-mutex-timedlock.c
index 13136ddfe1..e83bc57875 100644
--- a/sysdeps/mach/hurd/htl/pt-mutex-timedlock.c
+++ b/sysdeps/mach/hurd/htl/pt-mutex-timedlock.c
@@ -24,7 +24,7 @@
#include <hurdlock.h>
int
-pthread_mutex_timedlock (pthread_mutex_t *mtxp, const struct timespec *tsp)
+__pthread_mutex_timedlock (pthread_mutex_t *mtxp, const struct timespec *tsp)
{
struct __pthread *self;
int ret, flags = mtxp->__flags & GSYNC_SHARED;
@@ -76,3 +76,4 @@ pthread_mutex_timedlock (pthread_mutex_t *mtxp, const struct timespec *tsp)
return ret;
}
+strong_alias (__pthread_mutex_timedlock, pthread_mutex_timedlock)
--
2.24.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH 00/10] Port C11 threads to GNU/Hurd
@ 2020-01-14 18:52 Samuel Thibault
2020-01-14 18:52 ` [hurd,commited] htl: Add internal version of __pthread_mutex_timedlock Samuel Thibault
0 siblings, 1 reply; 2+ messages in thread
From: Samuel Thibault @ 2020-01-14 18:52 UTC (permalink / raw)
To: libc-alpha; +Cc: Samuel Thibault
Hello,
This patch series basiscally moves the C11 threads implementation to
sysdeps/pthread, thus making it available on GNU/Hurd as well. There
are a few changes that are needed, I'm here proposing them for review,
so we can probably commit them early in the 2.32 development.
Samuel
Samuel Thibault (10):
htl: Rename _pthread_mutex_init/destroy to __pthread_mutex_init/destroy
htl: Add missing internal functions declarations
htl: Add support for C11 threads behavior
htl: Make __PTHREAD_ONCE_INIT more flexible
nptl: Move nptl-specific types to separate header
C11 threads: do not require PTHREAD_DESTRUCTOR_ITERATIONS
C11 threads: Fix thrd_t / pthread_t compatibility assertion
C11 threads: make thrd_join more portable
htl: Add C11 threads types definitions
C11 threads: Move implementation to sysdeps/pthread
htl/Versions | 18 ++++++
htl/pt-create.c | 20 +++++-
htl/pt-initialize.c | 4 +-
htl/pt-internal.h | 3 +
nptl/Makefile | 14 +----
sysdeps/htl/bits/thread-shared-types.h | 13 ++++
.../htl/bits/types/struct___pthread_once.h | 2 +-
sysdeps/htl/pt-key.h | 2 +-
sysdeps/htl/pt-mutex-destroy.c | 5 +-
sysdeps/htl/pt-mutex-init.c | 4 +-
sysdeps/htl/pt-mutex-timedlock.c | 1 +
sysdeps/htl/pthread.h | 2 +-
sysdeps/htl/pthreadP.h | 23 ++++++-
sysdeps/htl/thrd_current.c | 31 +++++++++
sysdeps/htl/threads.h | 1 -
sysdeps/hurd/stdc-predef.h | 63 -------------------
sysdeps/mach/htl/thrd_yield.c | 26 ++++++++
sysdeps/mach/hurd/htl/pt-mutex-destroy.c | 5 +-
sysdeps/mach/hurd/htl/pt-mutex-init.c | 6 +-
sysdeps/mach/hurd/htl/pt-mutex-timedlock.c | 1 +
sysdeps/mach/hurd/i386/libc.abilist | 4 ++
sysdeps/mach/hurd/i386/libpthread.abilist | 23 ++++++-
sysdeps/nptl/bits/thread-shared-types.h | 10 +++
sysdeps/nptl/thrd_create.c | 2 +
sysdeps/pthread/Makefile | 18 ++++++
{nptl => sysdeps/pthread}/call_once.c | 2 +-
{nptl => sysdeps/pthread}/cnd_broadcast.c | 0
{nptl => sysdeps/pthread}/cnd_destroy.c | 0
{nptl => sysdeps/pthread}/cnd_init.c | 0
{nptl => sysdeps/pthread}/cnd_signal.c | 0
{nptl => sysdeps/pthread}/cnd_timedwait.c | 0
{nptl => sysdeps/pthread}/cnd_wait.c | 0
{nptl => sysdeps/pthread}/mtx_destroy.c | 0
{nptl => sysdeps/pthread}/mtx_init.c | 0
{nptl => sysdeps/pthread}/mtx_lock.c | 0
{nptl => sysdeps/pthread}/mtx_timedlock.c | 0
{nptl => sysdeps/pthread}/mtx_trylock.c | 0
{nptl => sysdeps/pthread}/mtx_unlock.c | 0
{nptl => sysdeps/pthread}/thrd_create.c | 8 +--
{nptl => sysdeps/pthread}/thrd_detach.c | 0
{nptl => sysdeps/pthread}/thrd_equal.c | 0
{nptl => sysdeps/pthread}/thrd_exit.c | 0
{nptl => sysdeps/pthread}/thrd_join.c | 2 +-
{nptl => sysdeps/pthread}/thrd_priv.h | 0
{nptl => sysdeps/pthread}/thrd_sleep.c | 0
sysdeps/{nptl => pthread}/threads.h | 13 ++--
{nptl => sysdeps/pthread}/tss_create.c | 2 +
{nptl => sysdeps/pthread}/tss_delete.c | 0
{nptl => sysdeps/pthread}/tss_get.c | 0
{nptl => sysdeps/pthread}/tss_set.c | 0
{nptl => sysdeps/pthread}/tst-call-once.c | 0
{nptl => sysdeps/pthread}/tst-cnd-basic.c | 0
{nptl => sysdeps/pthread}/tst-cnd-broadcast.c | 0
{nptl => sysdeps/pthread}/tst-cnd-timedwait.c | 0
{nptl => sysdeps/pthread}/tst-mtx-basic.c | 0
{nptl => sysdeps/pthread}/tst-mtx-recursive.c | 0
{nptl => sysdeps/pthread}/tst-mtx-timedlock.c | 0
{nptl => sysdeps/pthread}/tst-mtx-trylock.c | 0
{nptl => sysdeps/pthread}/tst-thrd-detach.c | 0
{nptl => sysdeps/pthread}/tst-thrd-sleep.c | 0
{nptl => sysdeps/pthread}/tst-tss-basic.c | 0
61 files changed, 220 insertions(+), 108 deletions(-)
create mode 100644 sysdeps/htl/thrd_current.c
delete mode 100644 sysdeps/htl/threads.h
delete mode 100644 sysdeps/hurd/stdc-predef.h
create mode 100644 sysdeps/mach/htl/thrd_yield.c
create mode 100644 sysdeps/nptl/thrd_create.c
rename {nptl => sysdeps/pthread}/call_once.c (95%)
rename {nptl => sysdeps/pthread}/cnd_broadcast.c (100%)
rename {nptl => sysdeps/pthread}/cnd_destroy.c (100%)
rename {nptl => sysdeps/pthread}/cnd_init.c (100%)
rename {nptl => sysdeps/pthread}/cnd_signal.c (100%)
rename {nptl => sysdeps/pthread}/cnd_timedwait.c (100%)
rename {nptl => sysdeps/pthread}/cnd_wait.c (100%)
rename {nptl => sysdeps/pthread}/mtx_destroy.c (100%)
rename {nptl => sysdeps/pthread}/mtx_init.c (100%)
rename {nptl => sysdeps/pthread}/mtx_lock.c (100%)
rename {nptl => sysdeps/pthread}/mtx_timedlock.c (100%)
rename {nptl => sysdeps/pthread}/mtx_trylock.c (100%)
rename {nptl => sysdeps/pthread}/mtx_unlock.c (100%)
rename {nptl => sysdeps/pthread}/thrd_create.c (82%)
rename {nptl => sysdeps/pthread}/thrd_detach.c (100%)
rename {nptl => sysdeps/pthread}/thrd_equal.c (100%)
rename {nptl => sysdeps/pthread}/thrd_exit.c (100%)
rename {nptl => sysdeps/pthread}/thrd_join.c (92%)
rename {nptl => sysdeps/pthread}/thrd_priv.h (100%)
rename {nptl => sysdeps/pthread}/thrd_sleep.c (100%)
rename sysdeps/{nptl => pthread}/threads.h (97%)
rename {nptl => sysdeps/pthread}/tss_create.c (96%)
rename {nptl => sysdeps/pthread}/tss_delete.c (100%)
rename {nptl => sysdeps/pthread}/tss_get.c (100%)
rename {nptl => sysdeps/pthread}/tss_set.c (100%)
rename {nptl => sysdeps/pthread}/tst-call-once.c (100%)
rename {nptl => sysdeps/pthread}/tst-cnd-basic.c (100%)
rename {nptl => sysdeps/pthread}/tst-cnd-broadcast.c (100%)
rename {nptl => sysdeps/pthread}/tst-cnd-timedwait.c (100%)
rename {nptl => sysdeps/pthread}/tst-mtx-basic.c (100%)
rename {nptl => sysdeps/pthread}/tst-mtx-recursive.c (100%)
rename {nptl => sysdeps/pthread}/tst-mtx-timedlock.c (100%)
rename {nptl => sysdeps/pthread}/tst-mtx-trylock.c (100%)
rename {nptl => sysdeps/pthread}/tst-thrd-detach.c (100%)
rename {nptl => sysdeps/pthread}/tst-thrd-sleep.c (100%)
rename {nptl => sysdeps/pthread}/tst-tss-basic.c (100%)
--
2.24.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* [hurd,commited] htl: Add internal version of __pthread_mutex_timedlock
2020-01-14 18:52 [PATCH 00/10] Port C11 threads to GNU/Hurd Samuel Thibault
@ 2020-01-14 18:52 ` Samuel Thibault
0 siblings, 0 replies; 2+ messages in thread
From: Samuel Thibault @ 2020-01-14 18:52 UTC (permalink / raw)
To: libc-alpha; +Cc: Samuel Thibault, commit-hurd
The C11 threads implementation will need it.
---
htl/Versions | 1 +
sysdeps/htl/pt-mutex-timedlock.c | 3 ++-
sysdeps/htl/pthreadP.h | 2 ++
sysdeps/mach/hurd/htl/pt-mutex-timedlock.c | 3 ++-
4 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/htl/Versions b/htl/Versions
index 1c306acf5c..77f7335b9c 100644
--- a/htl/Versions
+++ b/htl/Versions
@@ -155,5 +155,6 @@ libpthread {
__pthread_setspecific;
__pthread_getattr_np;
__pthread_attr_getstack;
+ __pthread_mutex_timedlock;
}
}
diff --git a/sysdeps/htl/pt-mutex-timedlock.c b/sysdeps/htl/pt-mutex-timedlock.c
index d0ebb2975e..0e50f38ef2 100644
--- a/sysdeps/htl/pt-mutex-timedlock.c
+++ b/sysdeps/htl/pt-mutex-timedlock.c
@@ -189,8 +189,9 @@ __pthread_mutex_timedlock_internal (struct __pthread_mutex *mutex,
}
int
-pthread_mutex_timedlock (struct __pthread_mutex *mutex,
+__pthread_mutex_timedlock (struct __pthread_mutex *mutex,
const struct timespec *abstime)
{
return __pthread_mutex_timedlock_internal (mutex, abstime);
}
+strong_alias (__pthread_mutex_timedlock, pthread_mutex_timedlock)
diff --git a/sysdeps/htl/pthreadP.h b/sysdeps/htl/pthreadP.h
index af0154538a..affe7cdf53 100644
--- a/sysdeps/htl/pthreadP.h
+++ b/sysdeps/htl/pthreadP.h
@@ -29,6 +29,8 @@ extern struct __pthread **__pthread_threads;
extern int _pthread_mutex_init (pthread_mutex_t *mutex, const pthread_mutexattr_t *attr);
extern int __pthread_mutex_lock (pthread_mutex_t *__mutex);
+extern int __pthread_mutex_timedlock (pthread_mutex_t *__mutex,
+ const struct timespec *__abstime);
extern int __pthread_mutex_unlock (pthread_mutex_t *__mutex);
extern int __pthread_cond_broadcast (pthread_cond_t *cond);
diff --git a/sysdeps/mach/hurd/htl/pt-mutex-timedlock.c b/sysdeps/mach/hurd/htl/pt-mutex-timedlock.c
index 13136ddfe1..e83bc57875 100644
--- a/sysdeps/mach/hurd/htl/pt-mutex-timedlock.c
+++ b/sysdeps/mach/hurd/htl/pt-mutex-timedlock.c
@@ -24,7 +24,7 @@
#include <hurdlock.h>
int
-pthread_mutex_timedlock (pthread_mutex_t *mtxp, const struct timespec *tsp)
+__pthread_mutex_timedlock (pthread_mutex_t *mtxp, const struct timespec *tsp)
{
struct __pthread *self;
int ret, flags = mtxp->__flags & GSYNC_SHARED;
@@ -76,3 +76,4 @@ pthread_mutex_timedlock (pthread_mutex_t *mtxp, const struct timespec *tsp)
return ret;
}
+strong_alias (__pthread_mutex_timedlock, pthread_mutex_timedlock)
--
2.24.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-01-14 18:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-13 19:42 [hurd,commited] htl: Add internal version of __pthread_mutex_timedlock Samuel Thibault
-- strict thread matches above, loose matches on Subject: below --
2020-01-14 18:52 [PATCH 00/10] Port C11 threads to GNU/Hurd Samuel Thibault
2020-01-14 18:52 ` [hurd,commited] htl: Add internal version of __pthread_mutex_timedlock Samuel Thibault
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).