OSDN Git Service

* configure.in (all_headers, all_lib2funcs): Remove.
[pf3gnuchains/gcc-fork.git] / gcc / ada / 5ztaprop.adb
index b543ae2..ba273d9 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                  B o d y                                 --
 --                                                                          --
---                             $Revision: 1.41 $
+--                             $Revision: 1.2 $
 --                                                                          --
 --             Copyright (C) 1991-2001 Florida State University             --
 --                                                                          --
@@ -249,7 +249,7 @@ package body System.Task_Primitives.Operations is
    ---------------------
 
    --  Note: mutexes and cond_variables needed per-task basis are
-   --        initialized in Intialize_TCB and the Storage_Error is
+   --        initialized in Initialize_TCB and the Storage_Error is
    --        handled. Other mutexes (such as All_Tasks_Lock, Memory_Lock...)
    --        used in RTS is initialized before any status change of RTS.
    --        Therefore rasing Storage_Error in the following routines
@@ -728,6 +728,8 @@ package body System.Task_Primitives.Operations is
       Cond_Attr : aliased pthread_condattr_t;
 
    begin
+      Self_ID.Common.LL.Thread := null_pthread;
+
       Result := pthread_mutexattr_init (Mutex_Attr'Access);
       pragma Assert (Result = 0 or else Result = ENOMEM);
 
@@ -898,6 +900,8 @@ package body System.Task_Primitives.Operations is
         Unchecked_Deallocation (Ada_Task_Control_Block, Task_ID);
 
    begin
+      T.Common.LL.Thread := null_pthread;
+
       Result := pthread_mutex_destroy (T.Common.LL.L'Access);
       pragma Assert (Result = 0);
 
@@ -989,7 +993,9 @@ package body System.Task_Primitives.Operations is
      (T           : ST.Task_ID;
       Thread_Self : Thread_Id) return Boolean is
    begin
-      if T.Common.LL.Thread /= Thread_Self then
+      if T.Common.LL.Thread /= null_pthread
+        and then T.Common.LL.Thread /= Thread_Self
+      then
          return taskSuspend (T.Common.LL.Thread) = 0;
       else
          return True;
@@ -1004,7 +1010,9 @@ package body System.Task_Primitives.Operations is
      (T           : ST.Task_ID;
       Thread_Self : Thread_Id) return Boolean is
    begin
-      if T.Common.LL.Thread /= Thread_Self then
+      if T.Common.LL.Thread /= null_pthread
+        and then T.Common.LL.Thread /= Thread_Self
+      then
          return taskResume (T.Common.LL.Thread) = 0;
       else
          return True;