bob smith
bob smith

Reputation: 55

How can I declare tasks inside an ada package?

I'm trying to write a program for a class. In the specifications, tasks cannot have any procedures or functions. I must use the package name to access Tasks. How can I go about doing this? Can I simply write something along the lines of

package hello is
   task sample is...
   end sample;
end hello;

Upvotes: 0

Views: 590

Answers (1)

Jacob Sparre Andersen
Jacob Sparre Andersen

Reputation: 6611

Yes.

You would of course have to put the task body in the package body.

Upvotes: 1

Related Questions