comp.lang.ada
 help / color / mirror / Atom feed
From: LeakyStain <leakstan@erols.com>
Subject: Re: Stream venting (long)
Date: 1998/12/31
Date: 1998-12-31T12:27:08+00:00	[thread overview]
Message-ID: <368B6D96.D728F0B7@erols.com> (raw)
In-Reply-To: 76etuo$uel$1@nnrp1.dejanews.com

robert_dewar@my-dejanews.com wrote:
> 
> Of *course* the locking belongs in the attribute routines,
> it could not be anywhere else. As for crappy interface, it
> is perfectly trivial to make an interface that simply
> allows:
> 
>    Stream_Lock;
>    ...
>    Stream_Unlock;
> 
> to be placed in each attribute routine for which atomicity
> is required (these primitives would properly take care of
> nesting).
> 
> (a) what is so crappy about this interface?

You could implement a lock using a Controlled type, where Initialize
locks and Finalize unlocks, giving this usage:

    declare
	Stream_Locker;
    begin
	stream use
    end;

That way, you don't have to worry about unlocking on exceptions. I
suspect Ted Dennison still won't be happy.

> (b) how could it possibly be avoided

No way, as you say, this is where it needs to be.

-- Stephe




  reply	other threads:[~1998-12-31  0:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-12-28  0:00 Stream venting (long) dennison
1998-12-29  0:00 ` robert_dewar
1998-12-29  0:00   ` dennison
1998-12-29  0:00     ` robert_dewar
1998-12-30  0:00       ` dennison
1998-12-30  0:00         ` robert_dewar
1998-12-30  0:00           ` dennison
1998-12-31  0:00             ` robert_dewar
1998-12-31  0:00               ` LeakyStain [this message]
1998-12-31  0:00                 ` dewar
1998-12-31  0:00                   ` dennison
replies disabled

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