comp.lang.ada
 help / color / mirror / Atom feed
From: Matthew Heaney <matthew_heaney@acm.org>
Subject: Re: Protected types made of ADT's, and Passive Iterators
Date: 1998/09/17
Date: 1998-09-17T00:00:00+00:00	[thread overview]
Message-ID: <m3af3z69g8.fsf@mheaney.ni.net> (raw)
In-Reply-To: 35F3F885.93B3D3AB@elca-matrix.ch

Mats Weber <Mats.Weber@elca-matrix.ch> 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





  reply	other threads:[~1998-09-17  0:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-09-04  0:00 Protected types made of ADT's, and Passive Iterators John Woodruff
1998-09-05  0:00 ` Tom Moran
1998-09-05  0:00 ` Matthew Heaney
1998-09-05  0:00   ` Tom Moran
1998-09-07  0:00   ` Mats Weber
1998-09-17  0:00     ` Matthew Heaney [this message]
1998-09-07  0:00 ` Mats Weber
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox