c++: adjust some tests for modules
[official-gcc.git] / gcc / ada / libgnat / s-gloloc.ads
blob85aa90b7c8df8bc9a27cd23b30870c17c2e29547
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT COMPILER COMPONENTS --
4 -- --
5 -- S Y S T E M . G L O B A L _ L O C K S --
6 -- --
7 -- S p e c --
8 -- --
9 -- Copyright (C) 1999-2024, Free Software Foundation, Inc. --
10 -- --
11 -- GNAT is free software; you can redistribute it and/or modify it under --
12 -- terms of the GNU General Public License as published by the Free Soft- --
13 -- ware Foundation; either version 3, or (at your option) any later ver- --
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE. --
17 -- --
18 -- As a special exception under Section 7 of GPL version 3, you are granted --
19 -- additional permissions described in the GCC Runtime Library Exception, --
20 -- version 3.1, as published by the Free Software Foundation. --
21 -- --
22 -- You should have received a copy of the GNU General Public License and --
23 -- a copy of the GCC Runtime Library Exception along with this program; --
24 -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
25 -- <http://www.gnu.org/licenses/>. --
26 -- --
27 -- GNAT was originally developed by the GNAT team at New York University. --
28 -- Extensive contributions were provided by Ada Core Technologies Inc. --
29 -- --
30 ------------------------------------------------------------------------------
32 -- This package contains the necessary routines to provide
33 -- reliable system wide locking capability.
35 package System.Global_Locks is
37 Lock_Error : exception;
38 -- Exception raised if a request cannot be executed on a lock
40 type Lock_Type is private;
41 -- Such a lock is a global lock between partitions. This lock is
42 -- uniquely defined between the partitions because of its name.
44 Null_Lock : constant Lock_Type;
45 -- This needs comments ???
47 procedure Create_Lock (Lock : out Lock_Type; Name : String);
48 -- Create or retrieve a global lock for the current partition using
49 -- its Name.
51 procedure Acquire_Lock (Lock : in out Lock_Type);
52 -- If the lock cannot be acquired because someone already owns it, this
53 -- procedure is supposed to wait and retry forever.
55 procedure Release_Lock (Lock : in out Lock_Type);
57 private
59 type Lock_Type is new Natural;
61 Null_Lock : constant Lock_Type := 0;
63 end System.Global_Locks;