From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24850 invoked by alias); 7 Nov 2002 21:41:07 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 24837 invoked from network); 7 Nov 2002 21:41:05 -0000 Received: from unknown (HELO desire.geoffk.org) (12.235.56.190) by sources.redhat.com with SMTP; 7 Nov 2002 21:41:05 -0000 Received: (from geoffk@localhost) by desire.geoffk.org (8.11.6/8.11.6) id gA7Lf2s02689; Thu, 7 Nov 2002 13:41:02 -0800 Date: Thu, 07 Nov 2002 13:41:00 -0000 From: Geoff Keating Message-Id: <200211072141.gA7Lf2s02689@desire.geoffk.org> To: mark@codesourcery.com CC: zack@codesourcery.com, rth@redhat.com, jakub@redhat.com, aldyh@redhat.com, gcc-patches@gcc.gnu.org, jason@redhat.com In-reply-to: <98840000.1036700986@warlock.codesourcery.com> (message from Mark Mitchell on Thu, 07 Nov 2002 12:29:46 -0800) Subject: Re: [basic-improvements] try/finally support for c/c++ - more tests References: <98840000.1036700986@warlock.codesourcery.com> X-SW-Source: 2002-11/txt/msg00505.txt.bz2 > Date: Thu, 07 Nov 2002 12:29:46 -0800 > From: Mark Mitchell > > --On Thursday, November 07, 2002 12:18:33 PM -0800 Geoff Keating > wrote: > > > Mark Mitchell writes: > > > >> We're trying to implement one particular piece of functionality required > >> by the POSIX threads interface; namely "pthread_cleanup_push" and > >> friends. (I know that any feature might get used more widely, but this > >> is the motivation, as I understand it.) Furthermore, we're trying to > >> make the POSIX threads cleanups play nice with exception-handling. > > > > Yes, this is right, but your example is not the case we really care > > about. What we particularly want to make work is this C++ code: > > > > struct A { ~A() { ... } }; > > > > { > > A foo; > > sigpause (); // cancellation point, I hope > > } > > > Here, if 'sigpause' gets cancelled, we want A's destructor to not be > > run. > > I think you mean you want it *to* be run? Yes. > These kinds of cases are easily handled by my #ifdef __cplusplus idea > for the pthread_cleanup_push definition. How? There aren't any pthread_cleanup_push calls in the example. You'd have to have sigpause (and the other cancellable calls) conditionalised on __cplusplus, and then to permit users to write programs in a mix of C and C++ you'd have to define some way to convert the exceptions thrown in C++ to the sj/lj calls in C. -- - Geoffrey Keating