2 -- { dg-options "-gnatws" }
6 with Ada
.Task_Identification
;
10 use Ada
.Task_Identification
;
14 protected Semaphore
is
18 TID
: Task_Id
:= Null_Task_Id
;
19 Lock_Count
: Natural := 0;
35 protected body Semaphore
is
41 entry Lock
when Lock_Count
= 0
42 or else TID
= Current_Task
47 or else TID
= Lock
'Caller)
50 ("Barrier leaks " & Lock_Count
'Img
52 & ' ' & Image
(Lock
'Caller));
55 Lock_Count
:= Lock_Count
+ 1;
65 if TID
= Current_Task
then
66 Lock_Count
:= Lock_Count
- 1;
83 task type Secondary
is
87 procedure Parse
(P1
: Positive);
93 procedure Parse
(P1
: Positive) is
111 task body Secondary
is
115 for K
in 1 .. 20 loop
119 raise Constraint_Error
;
122 when Program_Error
=>
126 TS
: array (1 .. 2) of Secondary
;
131 for J
in TS
'Range loop