This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v8 1/8] nptl: Add C11 threads thrd_* functions
On 08/02/2018 11:49, Gabriel F. T. Gomes wrote:
> I have only a few, minor comments.
>
> On Fri, 02 Feb 2018, Adhemerval Zanella wrote:
>
>> -/* We do not support C11 <threads.h>. */
>> -#define __STDC_NO_THREADS__ 1
>
> I don't know if that actually matters, but should you wait until the other
> patches in this series (at least patch 2) are in before removing this
> definition?
>
I do not have a strong opinion about when to remove __STDC_NO_THREADS__, since
my idea is first get all patches reviewed and acked before actually commit then.
>> +int
>> +thrd_sleep (const struct timespec* time_point, struct timespec* remaining)
>> +{
>> + /* It calls the syscalls directly to avoid cancellable version. */
>> + INTERNAL_SYSCALL_DECL (err);
>> + int ret = INTERNAL_SYSCALL_CALL (nanosleep, err, time_point, remaining);
>> + if (INTERNAL_SYSCALL_ERROR_P (ret, err))
>> + {
>> + /* C11 states thrd_sleep function returns -1 if it has been interrupted
>> + by a signal, or a negative value if it fails. */
> ~~~~~~~~~
> This hunk did not apply with git am, because there are more than 8 spaces.
Thanks, I fixed it locally (I also keep my user branch in sync [1]).
>
>> +/* Detach the thread identified by __THR from the current environment
>> + (tt does not allow join or wait for it). */
> ~~
> Did you mean "it"? Or is "tt" something else that I did not understand.
>
It should be 'it', fixed it locally.
[1] https://sourceware.org/git/?p=glibc.git;a=shortlog;h=refs/heads/azanella/c11-threads