This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Add and use new glibc-internal futex API.
- From: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- To: Torvald Riegel <triegel at redhat dot com>
- Cc: GLIBC Devel <libc-alpha at sourceware dot org>, Roland McGrath <roland at hack dot frob dot com>
- Date: Tue, 09 Jun 2015 15:14:36 -0300
- Subject: Re: [PATCH] Add and use new glibc-internal futex API.
- Authentication-results: sourceware.org; auth=none
- References: <1433796158 dot 21461 dot 438 dot camel at triegel dot csb> <5576F1A8 dot 6070304 at linaro dot org> <1433861222 dot 10071 dot 4 dot camel at triegel dot csb>
On 09-06-2015 11:47, Torvald Riegel wrote:
> On Tue, 2015-06-09 at 11:01 -0300, Adhemerval Zanella wrote:
>> On 08-06-2015 17:42, Torvald Riegel wrote:
>>> +/* Like futex_wait but cancelable. */
>>> +static __always_inline int
>>> +futex_wait_cancelable (unsigned int *futex_word, unsigned int expected,
>>> + int private)
>>> +{
>>> + int oldtype;
>>> + oldtype = __pthread_enable_asynccancel ();
>>> + int err = lll_futex_timed_wait (futex_word, expected, NULL, private);
>>> + __pthread_disable_asynccancel (oldtype);
>>> + switch (err)
>>
>> I would prefer to follow c6bb095eb and just create a lll_futex_timed_wait_cancel
>> that call SYSCALL_CANCEL instead (since the idea of my patch is just to remove
>> all the *_{enable,disable}_asynccancel calls). However I can also add this change
>> on my upcoming patches.
>
> My assumption was that we'll eventually phase out lll_futex_*. Using
> SYSCALL_CANCEL inside of the futex_* functions is perfectly fine for me.
> I just wanted to wait for your patch to land before we do that.
>
> We could also add lll_futex_*_wait_cancel, but I'd prefer to not add
> more lll_futex versions. I guess that whether we'd need
> lll_futex_*_wait_cancel for the lowlevellock would depend on whether
> your cancellation work goes in first or we use futex_ inside of the
> lowlevellock earlier.
>
> Let me know if you disagree or I misunderstood something.
>
Right, I can rebase my patches using your as it and calling SYSCALL_CANCEL
directly in futex_*_cancelable calls.