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,a31b00ad713d92f9 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!feeder3.cambrium.nl!feed.tweaknews.nl!newsfeed0.kamp.net!newsfeed.kamp.net!ndsoftware.com!zen.net.uk!dedekind.zen.co.uk!news-peer-lilac.gradwell.net!not-for-mail From: "Phil Slater" Newsgroups: comp.lang.ada References: <461cc46d$1_1@glkas0286.greenlnk.net> Subject: Re: Impossible problem? A protected buffer to queue objects of a class-wide type Date: Wed, 11 Apr 2007 14:02:09 +0100 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.3028 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 Message-ID: <461cd912$1_1@glkas0286.greenlnk.net> X-Original-NNTP-Posting-Host: glkas0286.greenlnk.net NNTP-Posting-Host: 20.133.0.1 X-Trace: 1176296550 news.gradwell.net 757 dnews/20.133.0.1:52296 X-Complaints-To: news-abuse@gradwell.net Xref: g2news1.google.com comp.lang.ada:14909 Date: 2007-04-11T14:02:09+01:00 List-Id: "Rob Norris" wrote in message news:ilkp139uool31fc8opd7b94jpmctvndeg3@4ax.com... > > >>(b) To support this call, Dequeue must be written as a function. As such, >>it >>cannot change the protected queue. What I need is the "entry" >>functionality, >>since I want the Dequeue to wait if the queue is empty, and I want the >>item >>to be removed from the queue as well as retrieved. > > Quick thought: > Is it possible to pass into the function a reference to the queue? > Then you should be able change the content of the queue as you see fit. > Maybe I didn't make myself clear. The queue is a protected object. None of the three types of protected operation (functions, procedures and entries), does what I need. I need the barrier/blocking of an entry, I need write access to change the protected data (the queue), but I also need the operation to *return* a value (like a function does) so that it can be received in calling code by using it to initialise a newly declared variable of a class-wide type.