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.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f0b43f606dcf86b2,start X-Google-Attributes: gid103376,public From: "DuckE" Subject: Re: Alsys Ada 83 to Green Hills Ada 95: ARTK Resource Manager Date: 1999/10/29 Message-ID: <381a77ca.0@news.pacifier.com>#1/1 X-Deja-AN: 542320529 References: <1rUZOBNgrjUOCSMI4WnzEyyo2oMj@4ax.com> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 X-Trace: 29 Oct 1999 21:44:58 PST, 216.65.140.160 X-MSMail-Priority: Normal Reply-To: "DuckE" Newsgroups: comp.lang.ada Date: 1999-10-29T00:00:00+00:00 List-Id: I believe what you're looking for is offered by Ada 95 protected types. Here is a small example of a protected type that implements a mutual exclusion semaphore: PROTECTED TYPE aMutex IS ENTRY LockMutex; PROCEDURE UnlockMutex; PRIVATE isLocked : BOOLEAN := FALSE; END aMutex; PROTECTED BODY aMutex IS ENTRY LockMutex WHEN NOT isLocked IS BEGIN isLocked := TRUE; END LockMutex; PROCEDURE UnlockMutex IS BEGIN isLocked := FALSE; END UnlockMutex; END aMutex; To create an instance of the protected type: SPIO2_RESOURCE_LOCK : aMutex; ... To obtain exclusive access to the resource: SPIO2_RESOURCE_LOCK.LockMutex; To release the resource: SPIO2_RESOURCE_LOCK.UnlockMutex; I hope this helps, SteveD Robert Kershaw, KG4ASZ wrote in message news:1rUZOBNgrjUOCSMI4WnzEyyo2oMj@4ax.com... > I need to update an Ada applications which was written using the Alsys > Ada 83 compiler to now use the Green Hill's AdaMULTI product and > WindRiver's VxWorks. > > The code has call to the Alsys's ARTK for resource management. > Example, calls are: > > with ARTK; > > package EXAMPLE is > > -- Set up analog resource so that only one task can call analog > routines > -- at a time > ANALOG_RESOURCE : ARTK.RESOURCES.RESOURCE; > > ... > > > Then later on when a resource is needed it uses the resource as shown > here: > > -- Start resource protection > SPIO2_READY := ARTK.RESOURCES.GET_RESOURCE > (SPIO2_RESOURCE); > > > .... > > -- Release resource protection > ARTK.RESOURCES.FREE_RESOURCE (SPIO2_RESOURCE); > > > How do I implement these same functions in Ada95? > > Does the AdaMULTI or VxWorks have equivalent functions? > > Does anyone have Alsys documentation on what these functions do? > > Thank You for your help, > > RSK > > > --------------------------------------------------- > NOSPAM_KG4ASZ@arrl.net > Delete obvious anti-spam garbage from the address (if present) for proper reply address.