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.6 required=5.0 tests=BAYES_05,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,146880aa5d8c64c7,start X-Google-Attributes: gid103376,public From: Larry Coon Subject: Array of tasks Date: 1997/12/09 Message-ID: <348D7832.27A4@assist.org>#1/1 X-Deja-AN: 296642083 Organization: University of California Reply-To: larry@assist.org Newsgroups: comp.lang.ada Date: 1997-12-09T00:00:00+00:00 List-Id: I posted a similar question from home a few days ago, and didn't see a response. I checked from work and didn't see my original question, so I'm posting again just in case something happened to my original post. My apologies if you've already seen this. I have an array of tasks and an array of semaphores. The size of both arrays are set at runtime (based on user input). I can't figure out a way to make the array of semaphores visible to the array of tasks. Here's some contrived code to illustrate what I'm trying to do: procedure main is protected type semaphore is entry seize; procedure release; private available: boolean := true; end semaphore; -- The usual implementation of a semaphore. protected body semaphore is separate; task type t; task body t is separate; task_count: positive; begin -- main put ("Enter number of tasks: "); get (task_count); declare subtype task_range is integer range 1..task_count; semaphore_array: array (task_range) of semaphore; task_array: array (task_range) of t; begin null; end; end; Within the body of task T I want to access a semaphore in semaphore_array. It won't compile, saying the semapore array is not visible. How do I declare things so the tasks can see the semaphores? I've tried nested blocks, and I've tried passing pointers to the semaphores, but couldn't get anything to work right. Thanks in advance for any help. Larry Coon University of California larry@assist.org and lmcoon@home.com