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,71daebeb6145ebb6 X-Google-Attributes: gid103376,public From: LeakyStain Subject: Re: Stream venting (long) Date: 1998/12/31 Message-ID: <368B6D96.D728F0B7@erols.com>#1/1 X-Deja-AN: 427434682 Content-Transfer-Encoding: 7bit References: <768sng$6r9$1@nnrp1.dejanews.com> <769g3r$moq$1@nnrp1.dejanews.com> <76aor7$l4q$1@nnrp1.dejanews.com> <76baib$4ne$1@nnrp1.dejanews.com> <76de7d$opb$1@nnrp1.dejanews.com> <76dh6m$r63$1@nnrp1.dejanews.com> <76doir$1ek$1@nnrp1.dejanews.com> <76etuo$uel$1@nnrp1.dejanews.com> Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@rcn.com X-Trace: Klmayf9M2H3gOtVySqPdUh9h68FwKWvvTISpdhVzegk= Mime-Version: 1.0 NNTP-Posting-Date: 31 Dec 1998 12:27:08 GMT Newsgroups: comp.lang.ada Date: 1998-12-31T12:27:08+00:00 List-Id: 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