I wrote this almost 3 years ago and I don't remember what was the original rationale, probably trying to be as independent from <pthread*.h> as possible, but in the end I've included <pthread.h> in <threads.h> in order to reuse regular symbols such as PTHREAD_ONCE_INIT. Thank you for pointing this. I will switch it to pthread_key_t (== int anyway). Another nit that I've noted after importing the patch into src/ is that I used __dead instead of _Noreturn. 3 years ago !C11 compilers were still in consideration, but it's not a concernt anymore. C11 threads support library expects compiler support for TLS anyway. I will switch this __dead to _Noreturn to be more aligned with the specification. On 24.04.2019 18:43, enh wrote: > any reason you're using `int` rather than `pthread_key_t` for `tss_t`? > (given that the other C11 types are just the pthread types.) for > Android, i'm going with all the types being the same, and wondered if > i missed something here? > > On Thu, Apr 18, 2019 at 6:30 PM Kamil Rytarowski <n54%gmx.com@localhost> wrote: >> >> I wrote a complete C11 threading support for NetBSD. >> >> The original implementation was written in 2016 and interrupted due to >> some issues in libpthread(3). These bugs are now gone. >> >> In the context of final implementation of C11 threads in GLIBC and the >> process of making it a part of POSIX, I've picked this work, cleaned up >> and added ATF tests. >> >> As noted by Joerg, an alternative way to implement C11 threads is to put >> it in libpthread(3) (instead of libc). This is a good idea as we can >> stop relying on libc stubs and stop adding more stubs that are still >> missing in libc. >> >> The patch includes man pages. >> >> http://netbsd.org/~kamil/patch-00104-c11threads-in-pthread.3.txt >> >> I intend to get it merged before the -9 branch. >> >> I'm open for comments. >>
Attachment:
signature.asc
Description: OpenPGP digital signature