This is the mail archive of the
libc-alpha@sourceware.cygnus.com
mailing list for the glibc project.
Re: Cancelling threads and C++ (LinuxThreads)
- To: george@moberg.com
- Subject: Re: Cancelling threads and C++ (LinuxThreads)
- From: Richard Henderson <rth@twiddle.net>
- Date: Mon, 28 Jun 1999 12:33:59 -0700
- Cc: libc-alpha@sourceware.cygnus.com, egcs@egcs.cygnus.com
- References: <XFMail.990628100320.george@moberg.com>
On Mon, Jun 28, 1999 at 10:03:20AM -0400, george@moberg.com wrote:
> This work-around works. However, I've corresponded with Dave Butenhof, who
> wrote "Programming with POSIX Threads". His opinion was that this solution
> isn't portable, and that the library implementing pthreads should see to it
> that destructors for stack-based objects are called without my program having
> to do anything special.
As quality-of-implementation, that's true. But pedanticly, the standard
(being for C) doesn't say anything about C++, and so relying on the
implementation to call destructors is also not portable.
> Is a patch to LinuxThreads to implement the throw/catch mechanism
> for cancelling threads appropriate? This would include the -fexceptions
> compile option for the entire C library.
I would not be opposed to it. Drepper would make the final decision.
> Would this require that a single mechanism for exceptions be used,
> rather than the two that are available in egcs now? (-fnew-exceptions
> vs. -fsjlj-exceptions)
Actually, the two mechanisms are -fsjlj-exceptions and -fno-sjlj-exceptions.
-fnew-exceptions does something different, and is forward compatible with
-fno-sjlj-exceptions.
But yes, you would be limited to one of -f{no-}sjlj-exceptions.
r~