pragma Polling (ON | OFF);
This pragma controls the generation of polling code. This is normally off.
pragma Polling (ON) is used then periodic calls are generated to
Ada.Exceptions.Poll. This routine is a separate unit in the
runtime library, and can be found in file
Polling can appear as a configuration pragma (for example it
can be placed in the
gnat.adc file) to enable polling globally, or it
can be used in the statement or declaration sequence to control polling
A call to the polling routine is generated at the start of every loop and
at the start of every subprogram call. This guarantees that the
routine is called frequently, and places an upper bound (determined by
the complexity of the code) on the period between two
The primary purpose of the polling interface is to enable asynchronous
aborts on targets that cannot otherwise support it (for example Windows
NT), but it may be used for any other purpose requiring periodic polling.
The standard version is null, and can be replaced by a user program. This
will require re-compilation of the
Ada.Exceptions package that can
be found in files
A standard alternative unit (in file
4wexcpol.adb in the standard GNAT
distribution) is used to enable the asynchronous abort capability on
targets that do not normally support the capability. The version of
Poll in this file makes a call to the appropriate runtime routine
to test for an abort condition.
Note that polling can also be enabled by use of the `-gnatP' switch. See the section on switches for gcc in the GNAT User’s Guide.