with Ada.Text_IO; procedure Demo is package Pkt is procedure Proc; end Pkt; package body Pkt is protected Prot is entry Proc; private entry Proc_Wait; end Prot; protected body Prot is entry Proc when True is begin Ada.Text_IO.Put_Line ("Pkt.Prot.Proc"); requeue Proc_Wait with abort; end Proc; entry Proc_Wait when False is begin Ada.Text_IO.Put_Line ("Pkt.Prot.Proc_Wait"); end Proc_Wait; end Prot; procedure Proc is begin Ada.Text_IO.Put_Line ("Pkt.Proc: start"); select Prot.Proc; Ada.Text_IO.Put_Line ("Pkt.Proc: Prot.Proc OK"); or delay 1.0; Ada.Text_IO.Put_Line ("Pkt.Proc: Prot.Proc timeout"); end select; end Proc; end Pkt; protected Outside_Prot is procedure Proc; end Outside_Prot; protected body Outside_Prot is procedure Proc is begin Ada.Text_IO.Put_Line ("Outside_Prot.Proc: start"); Pkt.Proc; end Proc; end Outside_Prot; begin Pkt.Proc; Outside_Prot.Proc; end Demo;