From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f678f,2c15cd92dd7e3b61 X-Google-Attributes: gidf678f,public X-Google-ArrivalTime: 1994-04-04 11:29:51 PST Newsgroups: comp.unix.osf.misc Path: gmd.de!newsserver.jvnc.net!netnews.upenn.edu!msuinfo!agate!howland.reston.ans.net!vixen.cso.uiuc.edu!sdd.hp.com!apollo.hp.com!netnews From: tatsu_s@apollo.hp.com (Seiichi Tatsukawa) Subject: Re: DCE Client/Server Exceptions Sender: usenet@apollo.hp.com (Usenet News) Message-ID: Date: Mon, 4 Apr 1994 18:29:51 GMT References: <1994Apr3.144347.27715@cgh.cgh.com> <2np4mf$7bh@paperboy.osf.org> Nntp-Posting-Host: kumi.ch.apollo.hp.com Organization: Hewlett-Packard Corporation, Chelmsford, MA Keywords: dce rpc osf client server In article <2np4mf$7bh@paperboy.osf.org> rsalz@osf.org (Rich Salz) writes: > #include > > int cancelmode; > > cancelmode = pthread_setcancel(CANCEL_OFF); > /* ...critical section here... */ > if (cancelmode == CANCEL_ON) > (void)pthread_setcancel(CANCEL_ON); And be careful about what you do in the critical section. If the non-cancelable thread gets blocked forever, your server looses one of the call executor threads... Also restoring the general cancelability can be done by just calling: (void)pthread_setcancel(cancelmode); I think, in general, the server manager routine should handle the forwarded cancel by using TRY/CATCH exception handling, e.g.: TRY { /* Do your critical work with the other process. */ } /* * If you want to handle the cancel specifically. */ CATCH(pthread_cancel_e) { ... } */ CATCH_ALL { /* Do the necessary cleanup for the connection with the other process. */ } ENDTRY --- Seiichi -- + Seiichi Tatsukawa (^[$BN)@n@:0l^[(B) tatsu_s@ch.hp.com + + Hewlett-Packard/Open Systems Software Division +