-- --
-- S p e c --
-- --
--- 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- --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNARL; see file COPYING. If not, write --
--- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
--- MA 02111-1307, USA. --
+-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
+-- Boston, MA 02110-1301, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- used for Thread_Id
package System.Task_Primitives.Operations is
+ pragma Preelaborate;
- pragma Elaborate_Body;
package ST renames System.Tasking;
package OSI renames System.OS_Interface;
-- call specified below. See locking rules in System.Tasking (spec) for
-- more details.
- procedure Initialize_Lock (Prio : System.Any_Priority; L : access Lock);
- procedure Initialize_Lock (L : access RTS_Lock; Level : Lock_Level);
+ procedure Initialize_Lock
+ (Prio : System.Any_Priority; L : not null access Lock);
+ procedure Initialize_Lock
+ (L : not null access RTS_Lock; Level : Lock_Level);
pragma Inline (Initialize_Lock);
-- Initialize a lock object.
--
--
-- These operations raise Storage_Error if a lack of storage is detected.
- procedure Finalize_Lock (L : access Lock);
- procedure Finalize_Lock (L : access RTS_Lock);
+ procedure Finalize_Lock (L : not null access Lock);
+ procedure Finalize_Lock (L : not null access RTS_Lock);
pragma Inline (Finalize_Lock);
-- Finalize a lock object, freeing any resources allocated by the
-- corresponding Initialize_Lock operation.
- procedure Write_Lock (L : access Lock; Ceiling_Violation : out Boolean);
- procedure Write_Lock (L : access RTS_Lock; Global_Lock : Boolean := False);
- procedure Write_Lock (T : ST.Task_Id);
+ procedure Write_Lock
+ (L : not null access Lock; Ceiling_Violation : out Boolean);
+ procedure Write_Lock
+ (L : not null access RTS_Lock; Global_Lock : Boolean := False);
+ procedure Write_Lock
+ (T : ST.Task_Id);
pragma Inline (Write_Lock);
-- Lock a lock object for write access. After this operation returns,
-- the calling task holds write permission for the lock object. No other
-- holds T's lock, or has interrupt-level priority. Finalization of the
-- per-task lock is implicit in Exit_Task.
- procedure Read_Lock (L : access Lock; Ceiling_Violation : out Boolean);
+ procedure Read_Lock
+ (L : not null access Lock; Ceiling_Violation : out Boolean);
pragma Inline (Read_Lock);
-- Lock a lock object for read access. After this operation returns,
-- the calling task has non-exclusive read permission for the logical
-- potential write access, and (3) implementations of priority ceiling
-- locking that make a reader-writer distinction have higher overhead.
- procedure Unlock (L : access Lock);
- procedure Unlock (L : access RTS_Lock; Global_Lock : Boolean := False);
- procedure Unlock (T : ST.Task_Id);
+ procedure Unlock
+ (L : not null access Lock);
+ procedure Unlock
+ (L : not null access RTS_Lock; Global_Lock : Boolean := False);
+ procedure Unlock
+ (T : ST.Task_Id);
pragma Inline (Unlock);
-- Unlock a locked lock object.
--
(Self_ID : ST.Task_Id;
Time : Duration;
Mode : ST.Delay_Modes);
- -- Implement the semantics of the delay statement. It is assumed that
- -- the caller is not abort-deferred and does not hold any locks.
+ -- Implement the semantics of the delay statement.
+ -- The caller should be abort-deferred and should not hold any locks.
procedure Wakeup
(T : ST.Task_Id;