summaryrefslogtreecommitdiffstats
path: root/gcc/ada/g-locfil.ads
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/g-locfil.ads')
-rw-r--r--gcc/ada/g-locfil.ads28
1 files changed, 18 insertions, 10 deletions
diff --git a/gcc/ada/g-locfil.ads b/gcc/ada/g-locfil.ads
index 47715c69bee..1034252548e 100644
--- a/gcc/ada/g-locfil.ads
+++ b/gcc/ada/g-locfil.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- $Revision: 1.2 $
+-- $Revision$
-- --
-- Copyright (C) 1995-2001 Ada Core Technologies, Inc. --
-- --
@@ -32,8 +32,8 @@
-- --
------------------------------------------------------------------------------
- -- This package contains the necessary routines for using files for the
- -- purpose of providing realiable system wide locking capability.
+-- This package contains the necessary routines for using files for the
+-- purpose of providing realiable system wide locking capability.
package GNAT.Lock_Files is
pragma Preelaborate;
@@ -41,27 +41,35 @@ pragma Preelaborate;
Lock_Error : exception;
-- Exception raised if file cannot be locked
+ subtype Path_Name is String;
+ -- Pathname is used by all services provided in this unit to specified
+ -- directory name and file name. On DOS based systems both directory
+ -- separators are handled (i.e. slash and backslash).
+
procedure Lock_File
- (Directory : String;
- Lock_File_Name : String;
+ (Directory : Path_Name;
+ Lock_File_Name : Path_Name;
Wait : Duration := 1.0;
Retries : Natural := Natural'Last);
-- Create a lock file Lock_File_Name in directory Directory. If the file
-- cannot be locked because someone already owns the lock, this procedure
-- waits Wait seconds and retries at most Retries times. If the file
-- still cannot be locked, Lock_Error is raised. The default is to try
- -- every second, almost forever (Natural'Last times).
+ -- every second, almost forever (Natural'Last times). The full path of
+ -- the file is constructed by concatenating Directory and Lock_File_Name.
+ -- Directory can optionally terminate with a directory separator.
procedure Lock_File
- (Lock_File_Name : String;
+ (Lock_File_Name : Path_Name;
Wait : Duration := 1.0;
Retries : Natural := Natural'Last);
-- See above. The full lock file path is given as one string.
- procedure Unlock_File (Directory : String; Lock_File_Name : String);
- -- Unlock a file
+ procedure Unlock_File (Directory : Path_Name; Lock_File_Name : Path_Name);
+ -- Unlock a file. Directory can optionally terminate with a directory
+ -- separator.
- procedure Unlock_File (Lock_File_Name : String);
+ procedure Unlock_File (Lock_File_Name : Path_Name);
-- Unlock a file whose full path is given in Lock_File_Name
end GNAT.Lock_Files;
OpenPOWER on IntegriCloud