File : a-excpol-abort.adb


   1 ------------------------------------------------------------------------------
   2 --                                                                          --
   3 --                 GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS                 --
   4 --                                                                          --
   5 --                   A D A . E X C E P T I O N S . P O L L                  --
   6 --                (version supporting asynchronous abort test)              --
   7 --                                                                          --
   8 --                                  B o d y                                 --
   9 --                                                                          --
  10 --          Copyright (C) 1992-2014, Free Software Foundation, Inc.         --
  11 --                                                                          --
  12 -- GNARL is free software; you can  redistribute it  and/or modify it under --
  13 -- terms of the  GNU General Public License as published  by the Free Soft- --
  14 -- ware  Foundation;  either version 3,  or (at your option) any later ver- --
  15 -- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
  16 -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
  17 -- or FITNESS FOR A PARTICULAR PURPOSE.                                     --
  18 --                                                                          --
  19 --                                                                          --
  20 --                                                                          --
  21 --                                                                          --
  22 --                                                                          --
  23 -- You should have received a copy of the GNU General Public License and    --
  24 -- a copy of the GCC Runtime Library Exception along with this program;     --
  25 -- see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    --
  26 -- <http://www.gnu.org/licenses/>.                                          --
  27 --                                                                          --
  28 -- GNARL was developed by the GNARL team at Florida State University.       --
  29 -- Extensive contributions were provided by Ada Core Technologies, Inc.     --
  30 --                                                                          --
  31 ------------------------------------------------------------------------------
  32 
  33 --  This version is for targets that do not support per-thread asynchronous
  34 --  signals. On such targets, we require compilation with the -gnatP switch
  35 --  that activates periodic polling. Then in the body of the polling routine
  36 --  we test for asynchronous abort.
  37 
  38 --  Windows and HPUX 10 currently use this file
  39 
  40 pragma Warnings (Off);
  41 --  Allow withing of non-Preelaborated units in Ada 2005 mode where this
  42 --  package will be categorized as Preelaborate. See AI-362 for details.
  43 --  It is safe in the context of the run-time to violate the rules.
  44 
  45 with System.Soft_Links;
  46 
  47 pragma Warnings (On);
  48 
  49 separate (Ada.Exceptions)
  50 
  51 ----------
  52 -- Poll --
  53 ----------
  54 
  55 procedure Poll is
  56 begin
  57    --  Test for asynchronous abort on each poll
  58 
  59    if System.Soft_Links.Check_Abort_Status.all /= 0 then
  60       raise Standard'Abort_Signal;
  61    end if;
  62 end Poll;