This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: question about which sleep is noted in manual
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: MaShimiao <mashimiao dot fnst at cn dot fujitsu dot com>
- Cc: <libc-alpha at sourceware dot org>, <codonell at redhat dot com>
- Date: Mon, 22 Dec 2014 16:24:50 -0200
- Subject: Re: question about which sleep is noted in manual
- Authentication-results: sourceware.org; auth=none
- References: <547ED48B dot 2060509 at cn dot fujitsu dot com> <oregs9zvl2 dot fsf at free dot home> <5487EAF0 dot 70305 at cn dot fujitsu dot com> <orfvcd7a7a dot fsf at free dot home> <549787C1 dot 9020807 at cn dot fujitsu dot com>
On Dec 22, 2014, MaShimiao <mashimiao.fnst@cn.fujitsu.com> wrote:
> 2. if funciont __sleep blocks SIGCHLD, no matter nanosleep() is cancelled or
> not, __seleep will restore the original signal mask before return.
If the thread is canceled, we won't take the normal execution path after
the nanosleep call; we'll only run cleanup handlers set up earlier in
the call chain, until the thread is terminated.
You may want to try it yourself: install a cleanup handler that probes
SIGCHLD in the signal mask, in a thread that calls sleep, and then
cancel the thread while sleep is running. You shouldn't see SIGCHLD
blocked in your cleanup handler, but without the proposed patch, you
will.
--
Alexandre Oliva, freedom fighter http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/ FSF Latin America board member
Free Software Evangelist|Red Hat Brasil GNU Toolchain Engineer