This is the mail archive of the glibc-bugs@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]

[Bug nptl/21291] pthread cancellation fails when contending lock


https://sourceware.org/bugzilla/show_bug.cgi?id=21291

--- Comment #18 from Dimitri Staessens <dimitri.staessens at ugent dot be> ---
Hi Torvald, 

I think the "existing special case for timeouts" is a bug in the POSIX
specification.

This is a previous version of the same paragraph that you have quoted:

http://pubs.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_09.html

Whenever a thread has cancelability enabled and a cancellation request has been
made with that thread as the target, and the thread then calls any function
that is a cancellation point (such as pthread_testcancel() or read()), the
cancellation request shall be acted upon before the function returns. If a
thread has cancelability enabled and a cancellation request is made with the
thread as a target while the thread is suspended at a cancellation point, the
thread shall be awakened and the cancellation request shall be acted upon.
However, if the thread is suspended at a cancellation point and the event for
which it is waiting occurs before the cancellation request is acted upon, it is
unspecified whether the cancellation request is acted upon or whether the
cancellation request remains pending and the thread resumes normal execution.

In this version, the clause that you see as a special case for timeouts is
actually relational. 

In all cases, functions that are in the "shall occur" list, have to check the
cancellation state before returning, even before returning EINVAL.

I am getting clarification from the Austin Group and making sure that they fix
it in their spec. Unless I am overlooking something big.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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