From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3816 invoked by alias); 17 Feb 2009 08:04:13 -0000 Received: (qmail 3705 invoked by uid 22791); 17 Feb 2009 08:04:12 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=BAYES_00,J_CHICKENPOX_23,J_CHICKENPOX_43 X-Spam-Check-By: sourceware.org Received: from lucius.provo.novell.com (HELO lucius.provo.novell.com) (137.65.248.127) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 17 Feb 2009 08:04:02 +0000 Received: from INET-PRV1-MTA by lucius.provo.novell.com with Novell_GroupWise; Tue, 17 Feb 2009 01:04:01 -0700 Message-Id: <499B0A1E02000016000052B3@lucius.provo.novell.com> Date: Tue, 17 Feb 2009 08:04:00 -0000 From: "Guan Jun He" To: Subject: about exception type issuse Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2009-02/txt/msg00112.txt.bz2 Dear All I write the following code,and get the an unknow exception.Would any body tell me what the exception is?why it can be catched by catch(...),but can not be catched by user's code. best, Guanjun code: #include #include #include #include #include #include #include #include #include #include #include #include typedef unsigned _Unwind_Exception_Class __attribute__((__mode__(__DI__))); void *thread(void*) { int i; pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, 0); pthread_setcanceltype(/*PTHREAD_CANCEL_ASYNCHRONOUS*/PTHREAD_CANCEL_DEFERRE= D, 0); try { for(i=3D0;/*i<3*/;i++) { //pthread_testcancel(); printf("This is a pthread.\n"); //pthread_testcancel(); } }catch(.../*_Unwind_Reason_Code &n*//*struct _Unwind_Exception &b*//*_Unwind_Exception_Class &u*/) { printf("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^This is the child thread: \n");/*%d .\n", n);*/ //throw; //a.what(); /*do nothing*/ } return 0; } int main(void) { pthread_t id; int ret; ret=3Dpthread_create(&id,NULL, thread,NULL); if(ret!=3D0){ printf ("Create pthread error!\n"); exit (1); } usleep(100); printf("********************This is the main thread.\n"); pthread_cancel(id); printf("********************This is the main thread.\n"); //pthread_join(id,0); return (0); }