1. -- 
  2. -- Uwe R. Zimmer, Australia, 2013 
  3. -- 
  4. -- 
  5. -- Synopsis: Bundles individual atomic action parts 
  6. --           and provides a single procedure to perform the atomic action. 
  7. -- 
  8. -- 
  9. -- Atomic actions are indivisible and and instantaneous. In case of 
  10. -- an atomic action, which consists itself of multiple concurrent parts, 
  11. -- some support for these conditions are provided here: 
  12. -- Either 
  13. --     - the full set of concurrent parts is completing their 
  14. --       action-part fully and without timing violations or other exceptions 
  15. --    or 
  16. --     - all parts of the action are executing a cleanup procedure to 
  17. --       restore the initial state (in case that any part of the action 
  18. --       was not able to complete fully) - regardless whether they completed 
  19. --       their action-part fully or to some extend, or whether they have 
  20. --       not even started executing it. 
  21. -- 
  22. -- Each concurrent part of the atomic action is defined by: 
  23. -- 
  24. --  (see also the definitions in atomic_action_types.ads) 
  25. -- 
  26. --   1. A minimal and maximal delay after which this part 
  27. --      of the atomic action is started. First this part is delayed 
  28. --      by the minimal delay time. Then, if the action-part is not active 
  29. --      after the maximal delay time, the whole action is stopped. 
  30. -- 
  31. --   2. This local action-part is started. 
  32. -- 
  33. --   3. If this action-part is not completed before the maximal elapse time 
  34. --      (starting with the actual activation of the task, after the delay) 
  35. --      and before the absolute deadline, the whole action is stopped. 
  36. -- 
  37. --   4. If this action-part is exiting with any exception, the whole 
  38. --      action is stopped. 
  39. -- 
  40. --   5. If the whole action is stopped, each part excecutes its 'cleanup' 
  41. --      procedure, in order to fully restore the initial state. 
  42. -- 
  43. -- All parts are blocked until either every part has completed its 
  44. -- action-part or every part (in case of a stopped action) has completed 
  45. -- its 'cleanup' procedure. Therefore the atomic action can only be completed 
  46. -- with all part successfully completed, or reset to the initial state. 
  47. -- 
  48. -- The final state of the atomic action is determined and exceptions are 
  49. -- propagated in case the atomic action was not successfully completed. 
  50. -- Timing violations are indicated with specific exceptions. All other 
  51. -- exceptions are propagated as the 'Failure_State' exception. 
  52. -- 
  53. ------------------------------------------------------------------ 
  54.  
  55. with Generic_Atomic_Action_Types; 
  56.  
  57. generic 
  58.    with package Atomic_Action_Types is new Generic_Atomic_Action_Types (<>); 
  59.  
  60.    Actions : Atomic_Action_Types.Action_Parts; 
  61.  
  62. package Generic_Atomic_Action is 
  63.  
  64.    -- 
  65.    -- Perform the atomic action 
  66.    -- 
  67.  
  68.    procedure Perform; 
  69.  
  70. end Generic_Atomic_Action;