g-thread.ads: Document use of "with GNAT.Threads" to ensure loading the tasking versi...
authorRobert Dewar <dewar@adacore.com>
Wed, 12 Sep 2007 11:58:50 +0000 (13:58 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Wed, 12 Sep 2007 11:58:50 +0000 (13:58 +0200)
2007-09-12  Robert Dewar  <dewar@adacore.com>

* g-thread.ads: Document use of "with GNAT.Threads" to ensure loading
the tasking version of the Ada run time when foreign threads are
present and there are no explicit Ada tasks or tasking constructs.

* gnat_rm.texi: Clarify documentation of GNAT.Threads.

From-SVN: r128428

gcc/ada/g-thread.ads
gcc/ada/gnat_rm.texi

index df2c67613f754e22b4a18d56dccfa46193d4249d..b5825f39f1f5c1d71b7701c1a5194d21d87ef5db 100644 (file)
 --                                                                          --
 ------------------------------------------------------------------------------
 
---  This package provides facilities for creation of foreign threads for
---  use as Ada tasks. In order to execute general Ada code, the run-time
---  system must know about all tasks. This package allows foreign code,
---  e.g. a C program, to create a thread that the Ada run-time knows about.
+--  This package provides facilities for creation or registration of foreign
+--  threads for use as Ada tasks. In order to execute general Ada code, the
+--  run-time system must know about all tasks. This package allows foreign
+--  code, e.g. a C program, to create a thread that the Ada run-time knows
+--  about, or to register the current thread.
+
+--  For some implementations of GNAT Pro, the registration of foreign threads
+--  is automatic. However, in such implementations, if the Ada program has no
+--  tasks at all and no tasking constructs other than delay, then by default
+--  the non-tasking version of the Ada run-time will be loaded. If foreign
+--  threads are present, it is important to ensure that the tasking version
+--  of the Ada run time is loaded. This may be achieved by adding "with
+--  GNAT.Threads" to any unit in the partition.
 
 with System;
 with Ada.Task_Identification;
index ce2daf3a030e7264baa6de0c403a29b4d8f1f374..61ce9a045a695c73a28d91e81e5128a5acabfbd9 100644 (file)
@@ -13661,11 +13661,10 @@ between tasks is very rarely expected.
 @cindex Threads, foreign
 
 @noindent
-Provides facilities for creating and destroying threads with explicit calls.
-These threads are known to the GNAT run-time system.  These subprograms are
-exported C-convention procedures intended to be called from foreign code.
-By using these primitives rather than directly calling operating systems
-routines, compatibility with the Ada tasking run-time is provided.
+Provides facilities for dealing with foreign threads which need to be known
+by the GNAT run-time system. Consult the documentation of this package for
+further details if your program has threads that are created by a non-Ada
+environment which then accesses Ada code.
 
 @node GNAT.Traceback (g-traceb.ads)
 @section @code{GNAT.Traceback} (@file{g-traceb.ads})