Search code examples
concurrencypackagetaskprocedureada

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;

Solution

  • Yes.

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