https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78075

            Bug ID: 78075
           Summary: Need a way to tell pthread_cancel don't to the forced
                    unwind
           Product: gcc
           Version: 4.5.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: baiyang at gmail dot com
  Target Milestone: ---

I want pthread_cancel 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,
like: pthread_setcancelmethod(PTHREAD_CANCEL_NO_UNWIND) ?

Reply via email to