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=3.8 required=5.0 tests=BAYES_00,INVALID_MSGID, RATWARE_MS_HASH,RATWARE_OUTLOOK_NONAME autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4ebc49648f2201b0 X-Google-Attributes: gid103376,public From: "Keith Allan Shillington" Subject: Re: File/Record locking in Ada Date: 1997/02/28 Message-ID: <01bc259a$a035e850$fc00af88@godiva>#1/1 X-Deja-AN: 222200986 Sender: news@thomsoft.com (USENET News Admin @flash) X-Nntp-Posting-Host: leonidas References: <3313101D.1BBF@aston.ac.uk> Organization: Aonix Newsgroups: comp.lang.ada Date: 1997-02-28T00:00:00+00:00 List-Id: Hmmm. That would be a protected type. protected type Record_Lock is entry Lock; procedure Unlock; private Locked : Boolean := False; end Record_Lock; protected body Record_Lock is entry Lock when not Locked is begin Locked := True; end Lock; procedure Unlock is begin Locked := False; end Unlock; end Record_Lock; (as in 9.4(26-29) RM95) You can add complexity to your hearts content, but this is a single path regardless of the number of tasks that interact with it. Dijkstras rules on semaphores apply. Stephen Godwin wrote in article <3313101D.1BBF@aston.ac.uk>... > Does anyone know of a record locking method I can use in Ada? > I've tried using the Forest(POSIX) libraries but can't get them to > compile under Solaris. > > Thanks, > > Stephen Godwin >