This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug nptl/20730] New: Need a way to tell pthread_cancel and pthread_exit don't do the forced unwind
- From: "baiyang at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Sat, 22 Oct 2016 19:59:28 +0000
- Subject: [Bug nptl/20730] New: Need a way to tell pthread_cancel and pthread_exit don't do the forced unwind
- Auto-submitted: auto-generated
https://sourceware.org/bugzilla/show_bug.cgi?id=20730
Bug ID: 20730
Summary: Need a way to tell pthread_cancel and pthread_exit
don't do the forced unwind
Product: glibc
Version: 2.13
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: nptl
Assignee: unassigned at sourceware dot org
Reporter: baiyang at gmail dot com
CC: drepper.fsp at gmail dot com
Target Milestone: ---
I want pthread_cancel and pthread_exit not throw __forced_unwind exception, and
there is no need to do the cleanup in our case. e.g.: I just want terminate the
thread immediately without ANY cleanup, like the TerminateThread Win32 API.
As far as I known, behaviors of the musl-libc and CLang libc are both equal to
the TerminateThread API.
I understand __forced_unwind is very useful in some cases, but it is clearly
unable to adapt to all situations.
So could we add a new API, let user set the wanted behavior of pthread_cancel
and pthread_exit, like: pthread_setcancelmethod(PTHREAD_CANCEL_NO_UNWIND)?
I'm using longjmp to implement the "TerminateThread" behavior now, but I think
it is valuable to support it directly by glibc.
--
You are receiving this mail because:
You are on the CC list for the bug.