s-taprop-posix.adb, [...] (Create_Task): Remove task adjustment code.
authorPascal Obry <obry@adacore.com>
Wed, 15 Feb 2006 09:29:59 +0000 (10:29 +0100)
committerArnaud Charlet <charlet@gcc.gnu.org>
Wed, 15 Feb 2006 09:29:59 +0000 (10:29 +0100)
2006-02-13  Pascal Obry  <obry@adacore.com>

* s-taprop-posix.adb, s-taprop-vxworks.adb, s-taprop-tru64.adb,
s-taprop-lynxos.adb, s-taprop-irix.adb, s-taprop-hpux-dce.adb,
s-taprop-linux.adb, s-taprop-solaris.adb,
s-taprop-vms.adb (Create_Task): Remove task adjustment code. This
adjustement is already done when calling this routine.

From-SVN: r111026

gcc/ada/s-taprop-hpux-dce.adb
gcc/ada/s-taprop-irix.adb
gcc/ada/s-taprop-linux.adb
gcc/ada/s-taprop-lynxos.adb
gcc/ada/s-taprop-posix.adb
gcc/ada/s-taprop-solaris.adb
gcc/ada/s-taprop-tru64.adb
gcc/ada/s-taprop-vms.adb
gcc/ada/s-taprop-vxworks.adb

index 5989c197a071bec8cf1bea8edc05bd8406b22caa..b72a82c321c224499481ca4920ddb2fe08e3d342 100644 (file)
@@ -779,24 +779,13 @@ package body System.Task_Primitives.Operations is
       Priority   : System.Any_Priority;
       Succeeded  : out Boolean)
    is
-      Attributes          : aliased pthread_attr_t;
-      Adjusted_Stack_Size : Interfaces.C.size_t;
-      Result              : Interfaces.C.int;
+      Attributes : aliased pthread_attr_t;
+      Result     : Interfaces.C.int;
 
       function Thread_Body_Access is new
         Unchecked_Conversion (System.Address, Thread_Body);
 
    begin
-      if Stack_Size = Unspecified_Size then
-         Adjusted_Stack_Size := Interfaces.C.size_t (Default_Stack_Size);
-
-      elsif Stack_Size < Minimum_Stack_Size then
-         Adjusted_Stack_Size := Interfaces.C.size_t (Minimum_Stack_Size);
-
-      else
-         Adjusted_Stack_Size := Interfaces.C.size_t (Stack_Size);
-      end if;
-
       Result := pthread_attr_init (Attributes'Access);
       pragma Assert (Result = 0 or else Result = ENOMEM);
 
@@ -806,7 +795,7 @@ package body System.Task_Primitives.Operations is
       end if;
 
       Result := pthread_attr_setstacksize
-        (Attributes'Access, Adjusted_Stack_Size);
+        (Attributes'Access, Interfaces.C.size_t (Stack_Size));
       pragma Assert (Result = 0);
 
       --  Since the initial signal mask of a thread is inherited from the
index 5c610b0585420c5566fe59f1674dee17a4812f8d..8b048e4725723bf4d5684292bbc82d0ff246eba7 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                  B o d y                                 --
 --                                                                          --
---         Copyright (C) 1992-2005, Free Software Foundation, Inc.          --
+--         Copyright (C) 1992-2006, Free Software Foundation, Inc.          --
 --                                                                          --
 -- GNARL is free software; you can  redistribute it  and/or modify it under --
 -- terms of the  GNU General Public License as published  by the Free Soft- --
@@ -60,19 +60,6 @@ with System.OS_Primitives;
 with System.IO;
 --  used for Put_Line
 
-with System.Parameters;
---  used for Size_Type
-
-with System.Program_Info;
---  used for Default_Task_Stack
---           Default_Time_Slice
---           Stack_Guard_Pages
---           Pthread_Sched_Signal
---           Pthread_Arena_Size
-
-with System.OS_Interface;
---  used for various type, constant, and operations
-
 with Unchecked_Conversion;
 with Unchecked_Deallocation;
 
@@ -763,10 +750,9 @@ package body System.Task_Primitives.Operations is
    is
       use System.Task_Info;
 
-      Attributes          : aliased pthread_attr_t;
-      Sched_Param         : aliased struct_sched_param;
-      Adjusted_Stack_Size : Interfaces.C.size_t;
-      Result              : Interfaces.C.int;
+      Attributes  : aliased pthread_attr_t;
+      Sched_Param : aliased struct_sched_param;
+      Result      : Interfaces.C.int;
 
       function Thread_Body_Access is new
         Unchecked_Conversion (System.Address, Thread_Body);
@@ -779,18 +765,6 @@ package body System.Task_Primitives.Operations is
         (System.Task_Info.Thread_Scheduling_Policy, Interfaces.C.int);
 
    begin
-      if Stack_Size = System.Parameters.Unspecified_Size then
-         Adjusted_Stack_Size :=
-           Interfaces.C.size_t (System.Program_Info.Default_Task_Stack);
-
-      elsif Stack_Size < Size_Type (Minimum_Stack_Size) then
-         Adjusted_Stack_Size :=
-           Interfaces.C.size_t (Minimum_Stack_Size);
-
-      else
-         Adjusted_Stack_Size := Interfaces.C.size_t (Stack_Size);
-      end if;
-
       Result := pthread_attr_init (Attributes'Access);
       pragma Assert (Result = 0 or else Result = ENOMEM);
 
@@ -804,7 +778,7 @@ package body System.Task_Primitives.Operations is
       pragma Assert (Result = 0);
 
       Result := pthread_attr_setstacksize
-        (Attributes'Access, Adjusted_Stack_Size);
+        (Attributes'Access, Interfaces.C.size_t (Stack_Size));
       pragma Assert (Result = 0);
 
       if T.Common.Task_Info /= null then
index 6cb7eb7e5cb094232375136afd830b1e452d5089..6a3596ead63780bafa9ee7bca9977d566bb7fdb1 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                  B o d y                                 --
 --                                                                          --
---         Copyright (C) 1992-2005, Free Software Foundation, Inc.          --
+--         Copyright (C) 1992-2006, Free Software Foundation, Inc.          --
 --                                                                          --
 -- GNARL is free software; you can  redistribute it  and/or modify it under --
 -- terms of the  GNU General Public License as published  by the Free Soft- --
@@ -44,9 +44,6 @@ with Interfaces.C;
 --  used for int
 --           size_t
 
-with System.Parameters;
---  used for Size_Type
-
 with System.Tasking.Debug;
 --  used for Known_Tasks
 
@@ -745,22 +742,10 @@ package body System.Task_Primitives.Operations is
       Priority   : System.Any_Priority;
       Succeeded  : out Boolean)
    is
-      Adjusted_Stack_Size : Interfaces.C.size_t;
-
       Attributes : aliased pthread_attr_t;
       Result     : Interfaces.C.int;
 
    begin
-      if Stack_Size = Unspecified_Size then
-         Adjusted_Stack_Size := Interfaces.C.size_t (Default_Stack_Size);
-
-      elsif Stack_Size < Minimum_Stack_Size then
-         Adjusted_Stack_Size := Interfaces.C.size_t (Minimum_Stack_Size);
-
-      else
-         Adjusted_Stack_Size := Interfaces.C.size_t (Stack_Size);
-      end if;
-
       Result := pthread_attr_init (Attributes'Access);
       pragma Assert (Result = 0 or else Result = ENOMEM);
 
@@ -771,7 +756,7 @@ package body System.Task_Primitives.Operations is
 
       Result :=
         pthread_attr_setstacksize
-          (Attributes'Access, Adjusted_Stack_Size);
+          (Attributes'Access, Interfaces.C.size_t (Stack_Size));
       pragma Assert (Result = 0);
 
       Result :=
index 06313ed5fdfd747d279ce64071048b6fb6b15415..a9b4cbbb82399d5afa4e3e0f81aa6f1a5272560b 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                  B o d y                                 --
 --                                                                          --
---         Copyright (C) 1992-2005, Free Software Foundation, Inc.          --
+--         Copyright (C) 1992-2006, Free Software Foundation, Inc.          --
 --                                                                          --
 -- GNARL is free software; you can  redistribute it  and/or modify it under --
 -- terms of the  GNU General Public License as published  by the Free Soft- --
@@ -59,9 +59,6 @@ with Interfaces.C;
 --  used for int
 --           size_t
 
-with System.Parameters;
---  used for Size_Type
-
 with Unchecked_Deallocation;
 
 package body System.Task_Primitives.Operations is
@@ -869,15 +866,7 @@ package body System.Task_Primitives.Operations is
       use System.Task_Info;
 
    begin
-      if Stack_Size = Unspecified_Size then
-         Adjusted_Stack_Size := Interfaces.C.size_t (Default_Stack_Size);
-
-      elsif Stack_Size < Minimum_Stack_Size then
-         Adjusted_Stack_Size := Interfaces.C.size_t (Minimum_Stack_Size);
-
-      else
-         Adjusted_Stack_Size := Interfaces.C.size_t (Stack_Size);
-      end if;
+      Adjusted_Stack_Size := Interfaces.C.size_t (Stack_Size);
 
       if Stack_Base_Available then
 
index 492c070ddcf335c293c84d69a2f862825bbb4f59..6195f242c7553d8d2afd5a79e10cb8313f218087 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                  B o d y                                 --
 --                                                                          --
---         Copyright (C) 1992-2005, Free Software Foundation, Inc.          --
+--         Copyright (C) 1992-2006, Free Software Foundation, Inc.          --
 --                                                                          --
 -- GNARL is free software; you can  redistribute it  and/or modify it under --
 -- terms of the  GNU General Public License as published  by the Free Soft- --
@@ -64,9 +64,6 @@ with Interfaces.C;
 --  used for int
 --           size_t
 
-with System.Parameters;
---  used for Size_Type
-
 with Unchecked_Conversion;
 with Unchecked_Deallocation;
 
@@ -892,15 +889,7 @@ package body System.Task_Primitives.Operations is
       use System.Task_Info;
 
    begin
-      if Stack_Size = Unspecified_Size then
-         Adjusted_Stack_Size := Interfaces.C.size_t (Default_Stack_Size);
-
-      elsif Stack_Size < Minimum_Stack_Size then
-         Adjusted_Stack_Size := Interfaces.C.size_t (Minimum_Stack_Size);
-
-      else
-         Adjusted_Stack_Size := Interfaces.C.size_t (Stack_Size);
-      end if;
+      Adjusted_Stack_Size := Interfaces.C.size_t (Stack_Size);
 
       if Stack_Base_Available then
          --  If Stack Checking is supported then allocate 2 additional pages:
index c9e1504779a889aa7ec99f1f9498fe979badd2c3..aa816b6746b59b3b9900d140c5404ec2cdcf270e 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                  B o d y                                 --
 --                                                                          --
---         Copyright (C) 1992-2005, Free Software Foundation, Inc.          --
+--         Copyright (C) 1992-2006, Free Software Foundation, Inc.          --
 --                                                                          --
 -- GNARL is free software; you can  redistribute it  and/or modify it under --
 -- terms of the  GNU General Public License as published  by the Free Soft- --
@@ -61,9 +61,6 @@ with Interfaces.C;
 --  used for int
 --           size_t
 
-with System.Parameters;
---  used for Size_Type
-
 with System.Task_Info;
 --  to initialize Task_Info for a C thread, in function Self
 
@@ -981,11 +978,11 @@ package body System.Task_Primitives.Operations is
    is
       pragma Unreferenced (Priority);
 
-      Result     : Interfaces.C.int;
+      Result              : Interfaces.C.int;
       Adjusted_Stack_Size : Interfaces.C.size_t;
-      Opts       : Interfaces.C.int := THR_DETACHED;
+      Opts                : Interfaces.C.int := THR_DETACHED;
 
-      Page_Size  : constant System.Parameters.Size_Type := 4096;
+      Page_Size           : constant System.Parameters.Size_Type := 4096;
       --  This constant is for reserving extra space at the
       --  end of the stack, which can be used by the stack
       --  checking as guard page. The idea is that we need
@@ -995,18 +992,7 @@ package body System.Task_Primitives.Operations is
       use System.Task_Info;
 
    begin
-      if Stack_Size = System.Parameters.Unspecified_Size then
-         Adjusted_Stack_Size :=
-           Interfaces.C.size_t (Default_Stack_Size + Page_Size);
-
-      elsif Stack_Size < Minimum_Stack_Size then
-         Adjusted_Stack_Size :=
-           Interfaces.C.size_t (Minimum_Stack_Size + Page_Size);
-
-      else
-         Adjusted_Stack_Size :=
-           Interfaces.C.size_t (Stack_Size + Page_Size);
-      end if;
+      Adjusted_Stack_Size := Interfaces.C.size_t (Stack_Size + Page_Size);
 
       --  Since the initial signal mask of a thread is inherited from the
       --  creator, and the Environment task has all its signals masked, we
index d4846d545e338baf5a154aff33d7a47b3b403149..d7e602a9e546a07f30488dc1eea38107fb8ba6aa 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                  B o d y                                 --
 --                                                                          --
---         Copyright (C) 1992-2005, Free Software Foundation, Inc.          --
+--         Copyright (C) 1992-2006, Free Software Foundation, Inc.          --
 --                                                                          --
 -- GNARL is free software; you can  redistribute it  and/or modify it under --
 -- terms of the  GNU General Public License as published  by the Free Soft- --
@@ -61,9 +61,6 @@ with Interfaces.C;
 --  used for int
 --           size_t
 
-with System.Parameters;
---  used for Size_Type
-
 with Unchecked_Deallocation;
 
 package body System.Task_Primitives.Operations is
@@ -780,20 +777,11 @@ package body System.Task_Primitives.Operations is
       use System.Task_Info;
 
    begin
-      if Stack_Size = Unspecified_Size then
-         Adjusted_Stack_Size := Interfaces.C.size_t (Default_Stack_Size);
-
-      elsif Stack_Size < Minimum_Stack_Size then
-         Adjusted_Stack_Size := Interfaces.C.size_t (Minimum_Stack_Size);
-
-      else
-         Adjusted_Stack_Size := Interfaces.C.size_t (Stack_Size);
-      end if;
-
       --  Account for the Yellow Zone (2 pages) and the guard page
       --  right above. See Hide_Yellow_Zone for the rationale.
 
-      Adjusted_Stack_Size := Adjusted_Stack_Size + 3 * Get_Page_Size;
+      Adjusted_Stack_Size :=
+        Interfaces.C.size_t (Stack_Size) + 3 * Get_Page_Size;
 
       Result := pthread_attr_init (Attributes'Access);
       pragma Assert (Result = 0 or else Result = ENOMEM);
index 896dbe11c468e14e19cc20c7ed74897490125f29..95a93b4fa25ce4b4ff381312a6eb57dc8592cf62 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                  B o d y                                 --
 --                                                                          --
---         Copyright (C) 1992-2005, Free Software Foundation, Inc.          --
+--         Copyright (C) 1992-2006, Free Software Foundation, Inc.          --
 --                                                                          --
 -- GNARL is free software; you can  redistribute it  and/or modify it under --
 -- terms of the  GNU General Public License as published  by the Free Soft- --
@@ -50,9 +50,6 @@ with Interfaces.C;
 --  used for int
 --           size_t
 
-with System.Parameters;
---  used for Size_Type
-
 with System.Soft_Links;
 --  used for Get_Exc_Stack_Addr
 
@@ -766,24 +763,13 @@ package body System.Task_Primitives.Operations is
       Priority   : System.Any_Priority;
       Succeeded  : out Boolean)
    is
-      Attributes          : aliased pthread_attr_t;
-      Adjusted_Stack_Size : Interfaces.C.size_t;
-      Result              : Interfaces.C.int;
+      Attributes : aliased pthread_attr_t;
+      Result     : Interfaces.C.int;
 
       function Thread_Body_Access is new
         Unchecked_Conversion (System.Address, Thread_Body);
 
    begin
-      if Stack_Size = Unspecified_Size then
-         Adjusted_Stack_Size := Interfaces.C.size_t (Default_Stack_Size);
-
-      elsif Stack_Size < Minimum_Stack_Size then
-         Adjusted_Stack_Size := Interfaces.C.size_t (Minimum_Stack_Size);
-
-      else
-         Adjusted_Stack_Size := Interfaces.C.size_t (Stack_Size);
-      end if;
-
       --  Since the initial signal mask of a thread is inherited from the
       --  creator, we need to set our local signal mask mask all signals
       --  during the creation operation, to make sure the new thread is
@@ -802,7 +788,7 @@ package body System.Task_Primitives.Operations is
       pragma Assert (Result = 0);
 
       Result := pthread_attr_setstacksize
-        (Attributes'Access, Adjusted_Stack_Size);
+        (Attributes'Access, Interfaces.C.size_t (Stack_Size));
       pragma Assert (Result = 0);
 
       --  This call may be unnecessary, not sure. ???
index 2165ea7f39c1ebc4721677d9aae0f648c418b7d4..56a02dda238137827d8f28b4cc704f42f64debb2 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                  B o d y                                 --
 --                                                                          --
---         Copyright (C) 1992-2005, Free Software Foundation, Inc.          --
+--         Copyright (C) 1992-2006, Free Software Foundation, Inc.          --
 --                                                                          --
 -- GNARL is free software; you can  redistribute it  and/or modify it under --
 -- terms of the  GNU General Public License as published  by the Free Soft- --
@@ -40,11 +40,6 @@ pragma Polling (Off);
 --  Turn off polling, we do not want ATC polling to take place during
 --  tasking operations. It causes infinite loops and other problems.
 
-with System.Tasking;
---  used for Ada_Task_Control_Block
---           Task_Id
---           ATCB components and types
-
 with System.Tasking.Debug;
 --  used for Known_Tasks
 
@@ -54,12 +49,6 @@ with System.Interrupt_Management;
 --           Signal_ID
 --           Initialize_Interrupts
 
-with System.OS_Interface;
---  used for various type, constant, and operations
-
-with System.Parameters;
---  used for Size_Type
-
 with Interfaces.C;
 
 with Unchecked_Conversion;
@@ -866,16 +855,6 @@ package body System.Task_Primitives.Operations is
    is
       Adjusted_Stack_Size : size_t;
    begin
-      if Stack_Size = Unspecified_Size then
-         Adjusted_Stack_Size := size_t (Default_Stack_Size);
-
-      elsif Stack_Size < Minimum_Stack_Size then
-         Adjusted_Stack_Size := size_t (Minimum_Stack_Size);
-
-      else
-         Adjusted_Stack_Size := size_t (Stack_Size);
-      end if;
-
       --  Ask for four extra bytes of stack space so that the ATCB pointer can
       --  be stored below the stack limit, plus extra space for the frame of
       --  Task_Wrapper. This is so the user gets the amount of stack requested
@@ -890,7 +869,7 @@ package body System.Task_Primitives.Operations is
       --  ??? - we should come back and visit this so we can set the task name
       --        to something appropriate.
 
-      Adjusted_Stack_Size := Adjusted_Stack_Size + 2048;
+      Adjusted_Stack_Size := size_t (Stack_Size) + 2048;
 
       --  Since the initial signal mask of a thread is inherited from the
       --  creator, and the Environment task has all its signals masked, we do