phcpack_2.4.88_e448e94a/src/Ada/Tasking/sigint_handler.ads

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
with Ada.Interrupts.Names;
 
package Sigint_Handler is

  -- defines a simple handler for the SIGINT signal

  protected Handler is

    entry Wait; -- decreases the call_count

    procedure Handle; -- increases the call_count

    pragma Interrupt_Handler(Handle);
    pragma Attach_Handler(Handle, Ada.Interrupts.Names.Sigint);

  private
    call_count : natural := 0;
  end Handler;
 
end Sigint_Handler;