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,FREEMAIL_FROM, INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a5d4c4e73313f0aa,start X-Google-Attributes: gid103376,public From: dlwester Subject: Ada 95 protected types and objects for controlled access. Date: 2000/06/01 Message-ID: <26813808.5e7ae0d1@usw-ex0101-006.remarq.com>#1/1 X-Deja-AN: 630000014 X-Originating-Host: 205.175.225.5 X-Complaints-To: wrenabuse@remarq.com X-Trace: WReNphoon3 959893847 10.0.2.6 (Thu, 01 Jun 2000 14:10:47 PDT) Organization: http://www.remarq.com: The World's Usenet/Discussions Start Here NNTP-Posting-Date: Thu, 01 Jun 2000 14:10:47 PDT Newsgroups: comp.lang.ada X-Wren-Trace: eMPmzs/WkduQh9vcw5DWz8Pw28nSyoLcyoHPz8eXiNOZi9KVmM2En5qMkg== Date: 2000-06-01T00:00:00+00:00 List-Id: The LRM is not very clear on some aspects of protected types. I understand how to create a type with protected data. I'm not quite sure what is needed to simply protect a thread. For instance, assuming the procedure 'Send_Data(x : in integer)' must not be interrupted (because it is not re-entrant, bad programing, etc.). Will the following protect the procedure from being interrupted by a higher level task calling it? protected Controlled_Access is procedure Controlled_Send(X : in Integer); end Controlled_Access; protected body Controlled_Access is procedure Controlled_Send(X : in Integer) is begin Send_Data(X : in Integer); -- The non-reentrant procedure. end Controlled_Send; end Controlled_Access; .. .. Controlled_Access.Controlled_Send(10); .. .. The alternative is to just make a controlled type and declare a variable to do the same stuff as above but the compiler does accept the above syntax that leads me to believe the above example is acceptable. Off Topic - Unbelievably the Rational Apex Ada NT compiler starts a new task for every protected object. The quality of Apex Ada compilers are really quite questionable. Thanks in advance. Don Westermeyer * Sent from RemarQ http://www.remarq.com The Internet's Discussion Network * The fastest and easiest way to search and participate in Usenet - Free!