[PATCH] Add and use new glibc-internal futex API.
Torvald Riegel
triegel@redhat.com
Tue Jun 9 14:50:00 GMT 2015
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.
More information about the Libc-alpha
mailing list