This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] misc: Add twalk_r function



> Il giorno 1 mag 2019, alle ore 03:11, Florian Weimer <fweimer@redhat.com> ha scritto:
> 
> * Adhemerval Zanella:
> 
>>> On 29/04/2019 09:51, Florian Weimer wrote:
>>> The twalk function is very difficult to use in a multi-threaded
>>> program because there is no way to pass external state to the
>>> iterator function.
>> 
>> LGTM as well, with some nits below (the whitespace you seems to 
>> fixed already).
>> 
>>> 
>>> (I expect to use this new function in sem_close and
>>> __gconv_release_shlib, but the function is generally useful.)
>> 
>> As a side note I worked on a sem_open/sem_close refactor some time ago
>> that uses dynarray and the char array derived structure, aimed to remove
>> both the twalk and alloca internal usage. It turned to be a slight simpler
>> implementation as well and I will try to send it upstream.
>> 
>> Reviewed-by: Carlos O'Donell <carlos@redhat.com>
> 
> I assume this should be your Reviewed-by?

Oops, indeed.

> 
>>> diff --git a/NEWS b/NEWS
>>> index 792ffb1ec8..a32bcbd7a4 100644
>>> --- a/NEWS
>>> +++ b/NEWS
>>> @@ -16,6 +16,8 @@ Major new features:
>>> * The dynamic linker accepts the --preload argument to preload shared
>>>   objects, in addition to the LD_PRELOAD environment variable.
>>> 
>>> +* The twalk_r function has been added.
>>> +
>> 
>> I think we can extend it description a bit by adding it is a GNU extension
>> that behaves like twalk but with an addional parameter to be passed in 
>> callback action function (like qsort_r).
> 
> “The twalk_r function has been added.  It is similar to the existing
> twalk function, but it passes an additional caller-supplied argument to
> the callback function.”
> 

LGTM.

> Thanks,
> Florian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]