procedure Essai17 is
TskAffiche : T_TskAffiche;
TempsDebut : Time := Clock;
task type T_Tsk (NbreSec : Integer := 0);
task TskServeur is
entry Synchro;
end TskServeur;
task body TskServeur is
begin -- TskServeur
loop
accept Synchro do
TskAffiche.JAffiche (Estampiller (TempsDebut) & " : " &
Image(Synchro'Caller) & " servie");
delay 3.0;
end Synchro;
TskAffiche.JAffiche (Estampiller (TempsDebut) & " : " &
"Serveur hors de Synchro");
delay 1.0;
end loop;
end TskServeur;
task body T_Tsk is
begin -- T_Tsk
delay NbreSec * 1.0;
TskAffiche.JAffiche
(Estampiller (TempsDebut) & " : " &
S_Identifier & " va appeler Synchro");
TskServeur.Synchro;
exception
when Tasking_Error =>
TskAffiche.JAffiche (Estampiller (TempsDebut) & " : " &
S_Identifier & " : Tasking_Error");
end T_Tsk;
T1 : T_Tsk;
T2 : T_Tsk (1);
T3, T4 : T_Tsk (2);
begin -- Essai17
delay 2.5;
abort T2;
delay 2.0;
abort T3;
delay 4.0;
abort TskServeur;
declare
ExcPropag : exception;
task TskServeur is
entry Entree;
end TskServeur;
task body TskServeur is
begin -- TskServeur
accept Entree do
raise ExcPropag;
end Entree;
exception
when ExcPropag =>
TskAffiche.JAffiche ("ExcPropag interceptee par le serveur");
end TskServeur;
begin
TskServeur.Entree;
exception
when ExcPropag =>
TskAffiche.JAffiche ("ExcPropag interceptee par le client");
end;
end Essai17;