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=0.6 required=5.0 tests=BAYES_40,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5c11488f5a203885,start X-Google-Attributes: gid103376,public From: "Juan Carlos =?iso-8859-1?Q?D=EDaz=20Mart=EDn?=" Subject: Imported Monolitic Monitor Date: 1999/03/05 Message-ID: <36E014CD.55717933@unex.es>#1/1 X-Deja-AN: 451631188 Content-Transfer-Encoding: 7bit Organization: Universidad de Extremadura X-Server-Date: 5 Mar 1999 17:33:02 GMT Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-03-05T17:33:02+00:00 List-Id: Let's be the C procedures in a module that share global data a b c and I make a C library with them. This library will be used by a multitasked Ada95 application by the pragma Import Tasks T, Q and R may invoke a, b or c in a concurrent, uncontrolled way. Isn't it? I'm interested in a, b and c to be executed in mutual exclusion to preserve global data integrity. The question is: How do I do it in Ada95? I've thought in a protected object, such as: protected Monitor is procedure a; procedure b; procedure c; end Monitor; The object could be used: with Monitor; procedure P is begin ... a; b; c; ... end P; task T is task Q is task R is begin begin begin P; P; P; end; end; end; Does this way guarantee mutual exclusion of a, b and c??? Any ideas?? Thanks in advance Juan Carlos