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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,922e1768d5791765 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!m73g2000cwd.googlegroups.com!not-for-mail From: "REH" Newsgroups: comp.lang.ada Subject: Re: Simulating OS semaphore behavior Date: 25 Aug 2006 08:25:13 -0700 Organization: http://groups.google.com Message-ID: <1156519513.574708.107940@m73g2000cwd.googlegroups.com> References: <1156518048.848919.126340@75g2000cwc.googlegroups.com> <3zrqu2whdwk2.1fobni2jyzalh.dlg@40tude.net> NNTP-Posting-Host: 192.91.173.42 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1156519519 9131 127.0.0.1 (25 Aug 2006 15:25:19 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 25 Aug 2006 15:25:19 +0000 (UTC) In-Reply-To: <3zrqu2whdwk2.1fobni2jyzalh.dlg@40tude.net> User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: m73g2000cwd.googlegroups.com; posting-host=192.91.173.42; posting-account=lnUIyw0AAACoRB2fMF2SFTIilm8F10q2 Xref: g2news2.google.com comp.lang.ada:6377 Date: 2006-08-25T08:25:13-07:00 List-Id: Dmitry A. Kazakov wrote: > That looks like a classic automatic event for multiple tasks. Make Signal > an entry: > > protected body Event is > entry Wait when Signal'Count > 0 is > begin > null; > end Wait; > entry Signal when Wait'Count = 0 is > begin > null; > end Signal; > end Event; > > Signal is blocked until all waiting tasks get released. There is no race > condition because fresh attempts to Wait are blocked if a signal is > pending. > Ah, just what I love: simple and elegant. Thank you! REH