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/20730] New: Need a way to tell pthread_cancel and pthread_exit don't do the forced unwind


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.

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