This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH v8 2/8] nptl: Add C11 threads mtx_* functions
- From: Florian Weimer <fweimer at redhat dot com>
- To: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>, libc-alpha at sourceware dot org
- Date: Fri, 6 Jul 2018 14:51:15 +0200
- Subject: Re: [PATCH v8 2/8] nptl: Add C11 threads mtx_* functions
- References: <email@example.com> <firstname.lastname@example.org>
On 02/02/2018 06:04 PM, Adhemerval Zanella wrote:
This patch adds the mtx_* definitions from C11 threads (ISO/IEC 9899:2011),
more specifically mtx_init, mtx_destroy, mtx_lock, mtx_timedlock, mtx_trylock,
mtx_unlock, and required types.
Mostly of the definitions are composed based on POSIX conterparts, and mtx_t
is also based on internal pthread fields, but with a distinct internal layout
to avoid possible issues with code interchange (such as trying to pass POSIX
structure on C11 functions and to avoid inclusion of pthread.h). The idea
is to make possible to share POSIX internal implementations for mostly of
the code (and making adjustment only when required).
Should we check for the supported mutex types and error out if the type
does not match? The interface does not support the full range of error
codes required by robust mutexes, for example—EOWNERDEAD is missing.