From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5b86cfa15b273e36 X-Google-Attributes: gid103376,public From: Mats Weber Subject: Re: Protected types made of ADT's, and Passive Iterators Date: 1998/09/07 Message-ID: <35F3F885.93B3D3AB@elca-matrix.ch>#1/1 X-Deja-AN: 388715755 Content-Transfer-Encoding: 7bit References: Content-Type: text/plain; charset=us-ascii Organization: ELCA Matrix SA Mime-Version: 1.0 Reply-To: Mats.Weber@elca-matrix.ch Newsgroups: comp.lang.ada Date: 1998-09-07T00:00:00+00:00 List-Id: Matthew Heaney wrote: > What's wrong with this: You need an exception handler to release the resource on a failure. Note that almost anything can be raised in Process. > generic > with procedure Process > (Item : in out Collection_Item; > Quit : in out Boolean); > procedure Modify_Items (Collection : in out Collection_Type); > > procedure Modify_Items (Collection : in out Collection_Type) is > > Quit : Boolean := False; > List : List_Type; > begin > > [as before] > > Release (Collection.Guard); exception when others => Release (Collection.Guard); raise; > > end Modify_Items;