comp.lang.ada
 help / color / mirror / Atom feed
* Program_Error from library level task declaration...
@ 1996-07-27  0:00 Dale Stanbrough
  1996-07-30  0:00 ` Theodore E. Dennison
  0 siblings, 1 reply; 3+ messages in thread
From: Dale Stanbrough @ 1996-07-27  0:00 UTC (permalink / raw)



Hi,

I've tried to create a library level semaphore to be used
for screen locking. The semaphore is the standard implementation
using a task (yes, I know a protected object would be better).

The declaration is...

with semaphores; use semaphores;
package screen_lock is

        screen:semaphore;

end screen_lock;


with screen_lock;
procedure main is
begin
	null;
end;

However this causes a program_error. I'm at a bit of a loss as
to how to fix this. Does anyone have any bright ideas?

Dale




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Program_Error from library level task declaration...
  1996-07-27  0:00 Program_Error from library level task declaration Dale Stanbrough
@ 1996-07-30  0:00 ` Theodore E. Dennison
  1996-07-31  0:00   ` Robert A Duff
  0 siblings, 1 reply; 3+ messages in thread
From: Theodore E. Dennison @ 1996-07-30  0:00 UTC (permalink / raw)



Dale Stanbrough wrote:
> I've tried to create a library level semaphore to be used
> for screen locking. The semaphore is the standard implementation
> using a task (yes, I know a protected object would be better).
> 
> The declaration is...
> 
> with semaphores; use semaphores;
> package screen_lock is
> 
>         screen:semaphore;
> 
> end screen_lock;
> 
...

> However this causes a program_error. I'm at a bit of a loss as
> to how to fix this. Does anyone have any bright ideas?

It would help to see the code for "semaphores" as well. Typically,
I see program error when,

   o  Someone tries to rendezvous with a task that has terminated.
   o  The code depends on the order of package elaboration (and the
      compiler guesses wrong).
   o  A function reaches the "end" without executing a "return" 
      statement.

(Note that if the "semaphore" task contains a terminate alternative,
the task may terminate once your main task terminates.)
-- 
T.E.D.          
                |  Work - mailto:dennison@escmail.orl.mmc.com  |
                |  Home - mailto:dennison@iag.net              |
                |  URL  - http://www.iag.net/~dennison         |




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Program_Error from library level task declaration...
  1996-07-30  0:00 ` Theodore E. Dennison
@ 1996-07-31  0:00   ` Robert A Duff
  0 siblings, 0 replies; 3+ messages in thread
From: Robert A Duff @ 1996-07-31  0:00 UTC (permalink / raw)



>Dale Stanbrough wrote:
>> I've tried to create a library level semaphore to be used
>> for screen locking. The semaphore is the standard implementation
>> using a task (yes, I know a protected object would be better).
>> 
>> The declaration is...
>> 
>> with semaphores; use semaphores;
>> package screen_lock is
>> 
>>         screen:semaphore;
>> 
>> end screen_lock;

It looks like you're activating a task whose body is not yet elaborated
(see 3.11(12)).  You should put pragma Preelaborate or Elaborate_Body on
the Semaphores package.  If that's illegal (can't tell without seeing
it), put pragma Elaborate_All(Semaphores) on the Screen_Lock package.

- Bob




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1996-07-31  0:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-07-27  0:00 Program_Error from library level task declaration Dale Stanbrough
1996-07-30  0:00 ` Theodore E. Dennison
1996-07-31  0:00   ` Robert A Duff

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox