(potentially blocking call if protected object busy or entry guard false) Takeoff := My_Runway; -- assign "out" parameter value to tell airplane which runway end Request_Takeoff; -- end of the synchronised part or accept Request_Approach (ID: in Airplane_ID; Approach: out Runway_Access) do My_Runway.Assign_Aircraft (ID); Approach := My_Runway; end Request_Approach; or -- terminate if no tasks left who could call terminate; end select; end loop; end; task body Airplane is Rwy : Runway_Access; begin Controller1.Request_Takeoff (ID, Rwy); -- This call blocks until Controller task accepts and completes the accept block Put_Line (Airplane_ID'Image (ID) & " taking off..."); delay 2.0; Rwy.Cleared_Runway (ID); -- call will not block as "Clear" in Rwy is now false and no other tasks should be inside protected object delay 5.0; -- fly around a bit... loop select -- try to request a runway Controller1.Request_Approach (ID, Rwy); -- this is a blocking call - will run on controller reaching accept block and return on completion exit; -- if call returned we're clear for landing - leave select block and proceed... or delay 3.0; -- timeout - if no answer in 3 seconds, do something else (everything in following block) Put_Line (Airplane_ID'Image (ID) & " in holding pattern"); -- simply print a message end select; end loop; delay 4.0; -- do landing approach... Put_Line (Airplane_ID'Image (ID) & " touched down!"); Rwy.Cleared_Runway (ID); -- notify runway that we're done here. end; New_Airplane: Airplane_Access; begin for I in Airplane_ID'Range loop -- create a few airplane tasks New_Airplane := new Airplane (I); -- will start running directly after creation delay 4.0; end loop; end Traffic; Pragmas A pragma is a compiler directive that conveys information to the compiler to allow specific manipulating of compiled output. Certain pragmas are built into the language, while others are implementation-specific. Examples of common usage of compiler pragmas would be to disable certain features, such as run-time type checking or array subscript boundary checking, or to instruct the compiler to insert object code instead of a function call (as C/C++ does with inline functions). Generics See also APSE – a specification for a programming environment to support software development in Ada Ravenscar profile – a subset of the Ada tasking features designed for safety-critical hard real-time computing SPARK (programming language) – a programming language consisting of a highly restricted subset of Ada, annotated with meta-information describing desired component behavior and individual runtime requirements References International standards ISO/IEC