Skip to content

Commit

Permalink
Slightly more meaningful names modification
Browse files Browse the repository at this point in the history
  • Loading branch information
dm-at-ada committed Jan 2, 2025
1 parent 1bf6569 commit e6d459c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ Ravenscar Tasks Declaration Example
package My_Tasks is
task type Printer;
P1 : Printer;
P2 : Printer;
Printer_Task_1 : Printer;
Printer_Task_2 : Printer;
end My_Tasks;
:filename:`my_tasks.adb`
Expand All @@ -45,7 +45,7 @@ Ravenscar Tasks Declaration Example
with Ada.Real_Time; use Ada.Real_Time;
package body My_Tasks is
P3 : Printer; -- correct
Printer_Task_3 : Printer; -- correct
task body Printer is
Period : Time_Span := Milliseconds (100);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Protected Objects
protected type
Protected_Value is
procedure Set (V : Integer);
procedure Set (Some_Value : Integer);
function Get return Integer;
private
Value : Integer;
Expand All @@ -30,9 +30,9 @@ Protected Objects
.. code:: Ada
protected body Protected_Value is
procedure Set (V : Integer) is
procedure Set (Some_Value : Integer) is
begin
Value := V;
Value := Some_Value;
end Set;
function Get return Integer is
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ Priorities
procedure Main is
pragma Priority (2);
task T is
task Some_Task is
pragma Priority (4);
protected Buffer is
Expand Down Expand Up @@ -167,18 +167,18 @@ Ceiling Locking

.. code::
L : Lock;
The_Lock : Lock;
T1 : Task (Priority => 1);
T2 : Task (Priority => 2);
T3 : Task (Priority => 3);
T1 locks L
T1 locks The_Lock
T3 starts, get scheduled (T3 > T1)
T3 tries to get L, blocks
T3 tries to get The_Lock, blocks
T2 starts, get scheduled (T2 > T1)
Result: T2 running, T1 blocked, T3 blocked through L (but T3 > T2!)
Result: T2 running, T1 blocked, T3 blocked through The_Lock (but T3 > T2!)
* Solved with ceiling locking

Expand All @@ -199,17 +199,17 @@ Ceiling Locking Example

.. code:: Ada
protected P with Priority => 5 is
procedure Set (V : Integer);
protected Protected_Obj with Priority => 5 is
procedure Set (Val : Integer);
.. code:: Ada
task T with Priority => 4 is
task Some_Task with Priority => 4 is
...
task body T is
task body Some_Task is
...
P.Set (1);
Protected_Obj.Set (1);
.. image:: ravenscar_ceiling_locking.png
:width: 45%
Expand Down

0 comments on commit e6d459c

Please sign in to comment.