-- --
-- B o d y --
-- --
--- $Revision: 1.41 $
+-- $Revision: 1.2 $
-- --
-- Copyright (C) 1991-2001 Florida State University --
-- --
---------------------
-- 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
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);
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);
(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;
(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;