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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID 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: Matthew Heaney Subject: Re: Protected types made of ADT's, and Passive Iterators Date: 1998/09/17 Message-ID: #1/1 X-Deja-AN: 391938595 Sender: matt@mheaney.ni.net References: <35F3F885.93B3D3AB@elca-matrix.ch> NNTP-Posting-Date: Wed, 16 Sep 1998 21:14:51 PDT Newsgroups: comp.lang.ada Date: 1998-09-17T00:00:00+00:00 List-Id: Mats Weber writes: > You need an exception handler to release the resource on a failure. Note that > almost anything can be raised in Process. Agreed. Actually, what I had in mind (and didn't show) was using a controlled type to lock and unlock the resource automatically: procedure Modify_Items (...) is Control : Collection_Control (Collection'Access); ... The Collection_Control object calls Seize during Initialize, and Release during Finalize. I omitted the error handling only to keep the example simple. I should have figured someone would catch that. Thanks for the correction. Matt