--------------------------------
-- Ivan Levashew aka OCTAGRAM --
--              Barnaul, 2009 --
--------------------------------

-- High-level interface to atomic operations

with
   System, Interfaces, Turbo_Private.Bits, Turbo_Private.Atomic;

use
   System, Interfaces;

package Turbo.Atomic is
   pragma Preelaborate;

   subtype Atomic_Integer_32 is Turbo_Private.Atomic.Atomic_Integer_32;

   function Get (Source : in Atomic_Integer_32)
      return Integer_32 renames Turbo_Private.Atomic.Get;
   function Get (Source : not null access Atomic_Integer_32)
      return Integer_32 renames Turbo_Private.Atomic.Get;

   function "+" (Source : in Atomic_Integer_32)
      return Integer_32 renames Get;
   function "+" (Source : not null access Atomic_Integer_32)
      return Integer_32 renames Get;

   function Lazy_Get (Source : in Atomic_Integer_32)
      return Integer_32 renames Turbo_Private.Atomic.Lazy_Get;
   function Lazy_Get (Source : not null access Atomic_Integer_32)
      return Integer_32 renames Turbo_Private.Atomic.Lazy_Get;

   procedure Set (Target : not null access Atomic_Integer_32;
      Item : Integer_32) renames Turbo_Private.Atomic.Set;
   procedure Set (Target : in out Atomic_Integer_32;
      Item : Integer_32) renames Turbo_Private.Atomic.Set;

   procedure Lazy_Set (Target : not null access Atomic_Integer_32;
      Item : Integer_32) renames Turbo_Private.Atomic.Lazy_Set;
   procedure Lazy_Set (Target : in out Atomic_Integer_32;
      Item : Integer_32) renames Turbo_Private.Atomic.Lazy_Set;

   function Create (Item : Integer_32) return Atomic_Integer_32
      renames Turbo_Private.Atomic.Create;

   function "+" (Item : Integer_32) return Atomic_Integer_32
      renames Create;

   function Lazy_Create (Item : Integer_32) return Atomic_Integer_32
      renames Turbo_Private.Atomic.Lazy_Create;

   function Swap (Target : not null access Atomic_Integer_32;
      Item : Integer_32) return Integer_32
      renames Turbo_Private.Atomic.Swap;
   
   function Compare_Swap (Target : not null access Atomic_Integer_32;
      Comparand, New_Item : Integer_32) return Boolean
      renames Turbo_Private.Atomic.Compare_Swap;
   function Compare_Swap (Target : not null access Atomic_Integer_32;
      Comparand, New_Item : Integer_32) return Integer_32
      renames Turbo_Private.Atomic.Compare_Swap;
   function Compare_Swap (Target : not null access Atomic_Integer_32;
      Comparand, New_Item : Integer_32; Fetched : not null access Integer_32)
      return Boolean renames Turbo_Private.Atomic.Compare_Swap;

   function Inc_Get (Addend : not null access Atomic_Integer_32)
      return Integer_32 renames Turbo_Private.Atomic.Inc_Get;
   function Get_Inc (Addend : not null access Atomic_Integer_32)
      return Integer_32 renames Turbo_Private.Atomic.Get_Inc;
   procedure Inc (Addend : in out Atomic_Integer_32)
      renames Turbo_Private.Atomic.Inc;
   procedure Inc (Addend : not null access Atomic_Integer_32)
      renames Turbo_Private.Atomic.Inc;

   function Inc_Get (Target : not null access Atomic_Integer_32;
      Item : Integer_32) return Integer_32
      renames Turbo_Private.Atomic.Inc_Get;
   function Get_Inc (Target : not null access Atomic_Integer_32;
      Item : Integer_32) return Integer_32
      renames Turbo_Private.Atomic.Get_Inc;
   procedure Inc (Target : in out Atomic_Integer_32;
      Item : Integer_32) renames Turbo_Private.Atomic.Inc;
   procedure Inc (Target : not null access Atomic_Integer_32;
      Item : Integer_32) renames Turbo_Private.Atomic.Inc;

   function Dec_Get (Addend : not null access Atomic_Integer_32)
      return Integer_32 renames Turbo_Private.Atomic.Dec_Get;
   function Get_Dec (Addend : not null access Atomic_Integer_32)
      return Integer_32 renames Turbo_Private.Atomic.Get_Dec;
   procedure Dec (Addend : in out Atomic_Integer_32)
      renames Turbo_Private.Atomic.Dec;
   procedure Dec (Addend : not null access Atomic_Integer_32)
      renames Turbo_Private.Atomic.Dec;

   function Dec_Get (Target : not null access Atomic_Integer_32;
      Item : Integer_32) return Integer_32
      renames Turbo_Private.Atomic.Dec_Get;
   function Get_Dec (Target : not null access Atomic_Integer_32;
      Item : Integer_32) return Integer_32
      renames Turbo_Private.Atomic.Get_Dec;
   procedure Dec (Target : in out Atomic_Integer_32;
      Item : Integer_32) renames Turbo_Private.Atomic.Dec;
   procedure Dec (Target : not null access Atomic_Integer_32;
      Item : Integer_32) renames Turbo_Private.Atomic.Dec;

   subtype Atomic_Unsigned_32 is Turbo_Private.Atomic.Atomic_Unsigned_32;

   function Get (Source : in Atomic_Unsigned_32)
      return Unsigned_32 renames Turbo_Private.Atomic.Get;
   function Get (Source : not null access Atomic_Unsigned_32)
      return Unsigned_32 renames Turbo_Private.Atomic.Get;

   function "+" (Source : in Atomic_Unsigned_32)
      return Unsigned_32 renames Get;
   function "+" (Source : not null access Atomic_Unsigned_32)
      return Unsigned_32 renames Get;

   function Lazy_Get (Source : in Atomic_Unsigned_32)
      return Unsigned_32 renames Turbo_Private.Atomic.Lazy_Get;
   function Lazy_Get (Source : not null access Atomic_Unsigned_32)
      return Unsigned_32 renames Turbo_Private.Atomic.Lazy_Get;

   procedure Set (Target : not null access Atomic_Unsigned_32;
      Item : Unsigned_32) renames Turbo_Private.Atomic.Set;
   procedure Set (Target : in out Atomic_Unsigned_32;
      Item : Unsigned_32) renames Turbo_Private.Atomic.Set;

   procedure Lazy_Set (Target : not null access Atomic_Unsigned_32;
      Item : Unsigned_32) renames Turbo_Private.Atomic.Lazy_Set;
   procedure Lazy_Set (Target : in out Atomic_Unsigned_32;
      Item : Unsigned_32) renames Turbo_Private.Atomic.Lazy_Set;

   function Create (Item : Unsigned_32) return Atomic_Unsigned_32
      renames Turbo_Private.Atomic.Create;

   function "+" (Item : Unsigned_32) return Atomic_Unsigned_32
      renames Create;

   function Lazy_Create (Item : Unsigned_32) return Atomic_Unsigned_32
      renames Turbo_Private.Atomic.Lazy_Create;

   function Swap (Target : not null access Atomic_Unsigned_32;
      Item : Unsigned_32) return Unsigned_32
      renames Turbo_Private.Atomic.Swap;
   
   function Compare_Swap (Target : not null access Atomic_Unsigned_32;
      Comparand, New_Item : Unsigned_32) return Boolean
      renames Turbo_Private.Atomic.Compare_Swap;
   function Compare_Swap (Target : not null access Atomic_Unsigned_32;
      Comparand, New_Item : Unsigned_32) return Unsigned_32
      renames Turbo_Private.Atomic.Compare_Swap;
   function Compare_Swap (Target : not null access Atomic_Unsigned_32;
      Comparand, New_Item : Unsigned_32; Fetched : not null access Unsigned_32)
      return Boolean renames Turbo_Private.Atomic.Compare_Swap;

   function Inc_Get (Addend : not null access Atomic_Unsigned_32)
      return Unsigned_32 renames Turbo_Private.Atomic.Inc_Get;
   function Get_Inc (Addend : not null access Atomic_Unsigned_32)
      return Unsigned_32 renames Turbo_Private.Atomic.Get_Inc;
   procedure Inc (Addend : in out Atomic_Unsigned_32)
      renames Turbo_Private.Atomic.Inc;
   procedure Inc (Addend : not null access Atomic_Unsigned_32)
      renames Turbo_Private.Atomic.Inc;

   function Inc_Get (Target : not null access Atomic_Unsigned_32;
      Item : Unsigned_32) return Unsigned_32
      renames Turbo_Private.Atomic.Inc_Get;
   function Get_Inc (Target : not null access Atomic_Unsigned_32;
      Item : Unsigned_32) return Unsigned_32
      renames Turbo_Private.Atomic.Get_Inc;
   procedure Inc (Target : in out Atomic_Unsigned_32;
      Item : Unsigned_32) renames Turbo_Private.Atomic.Inc;
   procedure Inc (Target : not null access Atomic_Unsigned_32;
      Item : Unsigned_32) renames Turbo_Private.Atomic.Inc;

   function Dec_Get (Addend : not null access Atomic_Unsigned_32)
      return Unsigned_32 renames Turbo_Private.Atomic.Dec_Get;
   function Get_Dec (Addend : not null access Atomic_Unsigned_32)
      return Unsigned_32 renames Turbo_Private.Atomic.Get_Dec;
   procedure Dec (Addend : in out Atomic_Unsigned_32)
      renames Turbo_Private.Atomic.Dec;
   procedure Dec (Addend : not null access Atomic_Unsigned_32)
      renames Turbo_Private.Atomic.Dec;

   function Dec_Get (Target : not null access Atomic_Unsigned_32;
      Item : Unsigned_32) return Unsigned_32
      renames Turbo_Private.Atomic.Dec_Get;
   function Get_Dec (Target : not null access Atomic_Unsigned_32;
      Item : Unsigned_32) return Unsigned_32
      renames Turbo_Private.Atomic.Get_Dec;
   procedure Dec (Target : in out Atomic_Unsigned_32;
      Item : Unsigned_32) renames Turbo_Private.Atomic.Dec;
   procedure Dec (Target : not null access Atomic_Unsigned_32;
      Item : Unsigned_32) renames Turbo_Private.Atomic.Dec;

   procedure Do_And (Addend : in out Atomic_Unsigned_32;
      Item : Unsigned_32) renames Turbo_Private.Atomic.Do_And;
   procedure Do_And (Addend : not null access Atomic_Unsigned_32;
      Item : Unsigned_32) renames Turbo_Private.Atomic.Do_And;

   procedure Do_Or (Addend : in out Atomic_Unsigned_32;
      Item : Unsigned_32) renames Turbo_Private.Atomic.Do_Or;
   procedure Do_Or (Addend : not null access Atomic_Unsigned_32;
      Item : Unsigned_32) renames Turbo_Private.Atomic.Do_Or;

   procedure Do_Xor (Addend : in out Atomic_Unsigned_32;
      Item : Unsigned_32) renames Turbo_Private.Atomic.Do_Xor;
   procedure Do_Xor (Addend : not null access Atomic_Unsigned_32;
      Item : Unsigned_32) renames Turbo_Private.Atomic.Do_Xor;

   subtype Atomic_Integer_64 is Turbo_Private.Atomic.Atomic_Integer_64;

   function Get (Source : in Atomic_Integer_64)
      return Integer_64 renames Turbo_Private.Atomic.Get;
   function Get (Source : not null access Atomic_Integer_64)
      return Integer_64 renames Turbo_Private.Atomic.Get;

   function "+" (Source : in Atomic_Integer_64)
      return Integer_64 renames Get;
   function "+" (Source : not null access Atomic_Integer_64)
      return Integer_64 renames Get;

   function Lazy_Get (Source : in Atomic_Integer_64)
      return Integer_64 renames Turbo_Private.Atomic.Lazy_Get;
   function Lazy_Get (Source : not null access Atomic_Integer_64)
      return Integer_64 renames Turbo_Private.Atomic.Lazy_Get;

   procedure Set (Target : not null access Atomic_Integer_64;
      Item : Integer_64) renames Turbo_Private.Atomic.Set;
   procedure Set (Target : in out Atomic_Integer_64;
      Item : Integer_64) renames Turbo_Private.Atomic.Set;

   procedure Lazy_Set (Target : not null access Atomic_Integer_64;
      Item : Integer_64) renames Turbo_Private.Atomic.Lazy_Set;
   procedure Lazy_Set (Target : in out Atomic_Integer_64;
      Item : Integer_64) renames Turbo_Private.Atomic.Lazy_Set;

   function Create (Item : Integer_64) return Atomic_Integer_64
      renames Turbo_Private.Atomic.Create;

   function "+" (Item : Integer_64) return Atomic_Integer_64
      renames Create;

   function Lazy_Create (Item : Integer_64) return Atomic_Integer_64
      renames Turbo_Private.Atomic.Lazy_Create;

   function Swap (Target : not null access Atomic_Integer_64;
      Item : Integer_64) return Integer_64
      renames Turbo_Private.Atomic.Swap;
   
   function Compare_Swap (Target : not null access Atomic_Integer_64;
      Comparand, New_Item : Integer_64) return Boolean
      renames Turbo_Private.Atomic.Compare_Swap;
   function Compare_Swap (Target : not null access Atomic_Integer_64;
      Comparand, New_Item : Integer_64) return Integer_64
      renames Turbo_Private.Atomic.Compare_Swap;
   function Compare_Swap (Target : not null access Atomic_Integer_64;
      Comparand, New_Item : Integer_64; Fetched : not null access Integer_64)
      return Boolean renames Turbo_Private.Atomic.Compare_Swap;

   function Inc_Get (Addend : not null access Atomic_Integer_64)
      return Integer_64 renames Turbo_Private.Atomic.Inc_Get;
   function Get_Inc (Addend : not null access Atomic_Integer_64)
      return Integer_64 renames Turbo_Private.Atomic.Get_Inc;
   procedure Inc (Addend : in out Atomic_Integer_64)
      renames Turbo_Private.Atomic.Inc;
   procedure Inc (Addend : not null access Atomic_Integer_64)
      renames Turbo_Private.Atomic.Inc;

   function Inc_Get (Target : not null access Atomic_Integer_64;
      Item : Integer_64) return Integer_64
      renames Turbo_Private.Atomic.Inc_Get;
   function Get_Inc (Target : not null access Atomic_Integer_64;
      Item : Integer_64) return Integer_64
      renames Turbo_Private.Atomic.Get_Inc;
   procedure Inc (Target : in out Atomic_Integer_64;
      Item : Integer_64) renames Turbo_Private.Atomic.Inc;
   procedure Inc (Target : not null access Atomic_Integer_64;
      Item : Integer_64) renames Turbo_Private.Atomic.Inc;

   function Dec_Get (Addend : not null access Atomic_Integer_64)
      return Integer_64 renames Turbo_Private.Atomic.Dec_Get;
   function Get_Dec (Addend : not null access Atomic_Integer_64)
      return Integer_64 renames Turbo_Private.Atomic.Get_Dec;
   procedure Dec (Addend : in out Atomic_Integer_64)
      renames Turbo_Private.Atomic.Dec;
   procedure Dec (Addend : not null access Atomic_Integer_64)
      renames Turbo_Private.Atomic.Dec;

   function Dec_Get (Target : not null access Atomic_Integer_64;
      Item : Integer_64) return Integer_64
      renames Turbo_Private.Atomic.Dec_Get;
   function Get_Dec (Target : not null access Atomic_Integer_64;
      Item : Integer_64) return Integer_64
      renames Turbo_Private.Atomic.Get_Dec;
   procedure Dec (Target : in out Atomic_Integer_64;
      Item : Integer_64) renames Turbo_Private.Atomic.Dec;
   procedure Dec (Target : not null access Atomic_Integer_64;
      Item : Integer_64) renames Turbo_Private.Atomic.Dec;

   subtype Atomic_Unsigned_64 is Turbo_Private.Atomic.Atomic_Unsigned_64;

   function Get (Source : in Atomic_Unsigned_64)
      return Unsigned_64 renames Turbo_Private.Atomic.Get;
   function Get (Source : not null access Atomic_Unsigned_64)
      return Unsigned_64 renames Turbo_Private.Atomic.Get;

   function "+" (Source : in Atomic_Unsigned_64)
      return Unsigned_64 renames Get;
   function "+" (Source : not null access Atomic_Unsigned_64)
      return Unsigned_64 renames Get;

   function Lazy_Get (Source : in Atomic_Unsigned_64)
      return Unsigned_64 renames Turbo_Private.Atomic.Lazy_Get;
   function Lazy_Get (Source : not null access Atomic_Unsigned_64)
      return Unsigned_64 renames Turbo_Private.Atomic.Lazy_Get;

   procedure Set (Target : not null access Atomic_Unsigned_64;
      Item : Unsigned_64) renames Turbo_Private.Atomic.Set;
   procedure Set (Target : in out Atomic_Unsigned_64;
      Item : Unsigned_64) renames Turbo_Private.Atomic.Set;

   procedure Lazy_Set (Target : not null access Atomic_Unsigned_64;
      Item : Unsigned_64) renames Turbo_Private.Atomic.Lazy_Set;
   procedure Lazy_Set (Target : in out Atomic_Unsigned_64;
      Item : Unsigned_64) renames Turbo_Private.Atomic.Lazy_Set;

   function Create (Item : Unsigned_64) return Atomic_Unsigned_64
      renames Turbo_Private.Atomic.Create;

   function "+" (Item : Unsigned_64) return Atomic_Unsigned_64
      renames Create;

   function Lazy_Create (Item : Unsigned_64) return Atomic_Unsigned_64
      renames Turbo_Private.Atomic.Lazy_Create;

   function Swap (Target : not null access Atomic_Unsigned_64;
      Item : Unsigned_64) return Unsigned_64
      renames Turbo_Private.Atomic.Swap;
   
   function Compare_Swap (Target : not null access Atomic_Unsigned_64;
      Comparand, New_Item : Unsigned_64) return Boolean
      renames Turbo_Private.Atomic.Compare_Swap;
   function Compare_Swap (Target : not null access Atomic_Unsigned_64;
      Comparand, New_Item : Unsigned_64) return Unsigned_64
      renames Turbo_Private.Atomic.Compare_Swap;
   function Compare_Swap (Target : not null access Atomic_Unsigned_64;
      Comparand, New_Item : Unsigned_64; Fetched : not null access Unsigned_64)
      return Boolean renames Turbo_Private.Atomic.Compare_Swap;

   function Inc_Get (Addend : not null access Atomic_Unsigned_64)
      return Unsigned_64 renames Turbo_Private.Atomic.Inc_Get;
   function Get_Inc (Addend : not null access Atomic_Unsigned_64)
      return Unsigned_64 renames Turbo_Private.Atomic.Get_Inc;
   procedure Inc (Addend : in out Atomic_Unsigned_64)
      renames Turbo_Private.Atomic.Inc;
   procedure Inc (Addend : not null access Atomic_Unsigned_64)
      renames Turbo_Private.Atomic.Inc;

   function Inc_Get (Target : not null access Atomic_Unsigned_64;
      Item : Unsigned_64) return Unsigned_64
      renames Turbo_Private.Atomic.Inc_Get;
   function Get_Inc (Target : not null access Atomic_Unsigned_64;
      Item : Unsigned_64) return Unsigned_64
      renames Turbo_Private.Atomic.Get_Inc;
   procedure Inc (Target : in out Atomic_Unsigned_64;
      Item : Unsigned_64) renames Turbo_Private.Atomic.Inc;
   procedure Inc (Target : not null access Atomic_Unsigned_64;
      Item : Unsigned_64) renames Turbo_Private.Atomic.Inc;

   function Dec_Get (Addend : not null access Atomic_Unsigned_64)
      return Unsigned_64 renames Turbo_Private.Atomic.Dec_Get;
   function Get_Dec (Addend : not null access Atomic_Unsigned_64)
      return Unsigned_64 renames Turbo_Private.Atomic.Get_Dec;
   procedure Dec (Addend : in out Atomic_Unsigned_64)
      renames Turbo_Private.Atomic.Dec;
   procedure Dec (Addend : not null access Atomic_Unsigned_64)
      renames Turbo_Private.Atomic.Dec;

   function Dec_Get (Target : not null access Atomic_Unsigned_64;
      Item : Unsigned_64) return Unsigned_64
      renames Turbo_Private.Atomic.Dec_Get;
   function Get_Dec (Target : not null access Atomic_Unsigned_64;
      Item : Unsigned_64) return Unsigned_64
      renames Turbo_Private.Atomic.Get_Dec;
   procedure Dec (Target : in out Atomic_Unsigned_64;
      Item : Unsigned_64) renames Turbo_Private.Atomic.Dec;
   procedure Dec (Target : not null access Atomic_Unsigned_64;
      Item : Unsigned_64) renames Turbo_Private.Atomic.Dec;

   procedure Do_And (Addend : in out Atomic_Unsigned_64;
      Item : Unsigned_64) renames Turbo_Private.Atomic.Do_And;
   procedure Do_And (Addend : not null access Atomic_Unsigned_64;
      Item : Unsigned_64) renames Turbo_Private.Atomic.Do_And;

   procedure Do_Or (Addend : in out Atomic_Unsigned_64;
      Item : Unsigned_64) renames Turbo_Private.Atomic.Do_Or;
   procedure Do_Or (Addend : not null access Atomic_Unsigned_64;
      Item : Unsigned_64) renames Turbo_Private.Atomic.Do_Or;

   procedure Do_Xor (Addend : in out Atomic_Unsigned_64;
      Item : Unsigned_64) renames Turbo_Private.Atomic.Do_Xor;
   procedure Do_Xor (Addend : not null access Atomic_Unsigned_64;
      Item : Unsigned_64) renames Turbo_Private.Atomic.Do_Xor;

   subtype Atomic_Integer_Addr is Turbo_Private.Atomic.Atomic_Integer_Addr;

   function Get (Source : in Atomic_Integer_Addr)
      return Integer_Addr renames Turbo_Private.Atomic.Get;
   function Get (Source : not null access Atomic_Integer_Addr)
      return Integer_Addr renames Turbo_Private.Atomic.Get;

   function "+" (Source : in Atomic_Integer_Addr)
      return Integer_Addr renames Get;
   function "+" (Source : not null access Atomic_Integer_Addr)
      return Integer_Addr renames Get;

   function Lazy_Get (Source : in Atomic_Integer_Addr)
      return Integer_Addr renames Turbo_Private.Atomic.Lazy_Get;
   function Lazy_Get (Source : not null access Atomic_Integer_Addr)
      return Integer_Addr renames Turbo_Private.Atomic.Lazy_Get;

   procedure Set (Target : not null access Atomic_Integer_Addr;
      Item : Integer_Addr) renames Turbo_Private.Atomic.Set;
   procedure Set (Target : in out Atomic_Integer_Addr;
      Item : Integer_Addr) renames Turbo_Private.Atomic.Set;

   procedure Lazy_Set (Target : not null access Atomic_Integer_Addr;
      Item : Integer_Addr) renames Turbo_Private.Atomic.Lazy_Set;
   procedure Lazy_Set (Target : in out Atomic_Integer_Addr;
      Item : Integer_Addr) renames Turbo_Private.Atomic.Lazy_Set;

   function Create (Item : Integer_Addr) return Atomic_Integer_Addr
      renames Turbo_Private.Atomic.Create;

   function "+" (Item : Integer_Addr) return Atomic_Integer_Addr
      renames Create;

   function Lazy_Create (Item : Integer_Addr) return Atomic_Integer_Addr
      renames Turbo_Private.Atomic.Lazy_Create;

   function Swap (Target : not null access Atomic_Integer_Addr;
      Item : Integer_Addr) return Integer_Addr
      renames Turbo_Private.Atomic.Swap;
   
   function Compare_Swap (Target : not null access Atomic_Integer_Addr;
      Comparand, New_Item : Integer_Addr) return Boolean
      renames Turbo_Private.Atomic.Compare_Swap;
   function Compare_Swap (Target : not null access Atomic_Integer_Addr;
      Comparand, New_Item : Integer_Addr) return Integer_Addr
      renames Turbo_Private.Atomic.Compare_Swap;
   function Compare_Swap (Target : not null access Atomic_Integer_Addr;
      Comparand, New_Item : Integer_Addr; Fetched : not null access Integer_Addr)
      return Boolean renames Turbo_Private.Atomic.Compare_Swap;

   function Inc_Get (Addend : not null access Atomic_Integer_Addr)
      return Integer_Addr renames Turbo_Private.Atomic.Inc_Get;
   function Get_Inc (Addend : not null access Atomic_Integer_Addr)
      return Integer_Addr renames Turbo_Private.Atomic.Get_Inc;
   procedure Inc (Addend : in out Atomic_Integer_Addr)
      renames Turbo_Private.Atomic.Inc;
   procedure Inc (Addend : not null access Atomic_Integer_Addr)
      renames Turbo_Private.Atomic.Inc;

   function Inc_Get (Target : not null access Atomic_Integer_Addr;
      Item : Integer_Addr) return Integer_Addr
      renames Turbo_Private.Atomic.Inc_Get;
   function Get_Inc (Target : not null access Atomic_Integer_Addr;
      Item : Integer_Addr) return Integer_Addr
      renames Turbo_Private.Atomic.Get_Inc;
   procedure Inc (Target : in out Atomic_Integer_Addr;
      Item : Integer_Addr) renames Turbo_Private.Atomic.Inc;
   procedure Inc (Target : not null access Atomic_Integer_Addr;
      Item : Integer_Addr) renames Turbo_Private.Atomic.Inc;

   function Dec_Get (Addend : not null access Atomic_Integer_Addr)
      return Integer_Addr renames Turbo_Private.Atomic.Dec_Get;
   function Get_Dec (Addend : not null access Atomic_Integer_Addr)
      return Integer_Addr renames Turbo_Private.Atomic.Get_Dec;
   procedure Dec (Addend : in out Atomic_Integer_Addr)
      renames Turbo_Private.Atomic.Dec;
   procedure Dec (Addend : not null access Atomic_Integer_Addr)
      renames Turbo_Private.Atomic.Dec;

   function Dec_Get (Target : not null access Atomic_Integer_Addr;
      Item : Integer_Addr) return Integer_Addr
      renames Turbo_Private.Atomic.Dec_Get;
   function Get_Dec (Target : not null access Atomic_Integer_Addr;
      Item : Integer_Addr) return Integer_Addr
      renames Turbo_Private.Atomic.Get_Dec;
   procedure Dec (Target : in out Atomic_Integer_Addr;
      Item : Integer_Addr) renames Turbo_Private.Atomic.Dec;
   procedure Dec (Target : not null access Atomic_Integer_Addr;
      Item : Integer_Addr) renames Turbo_Private.Atomic.Dec;

   subtype Atomic_Unsigned_Addr is Turbo_Private.Atomic.Atomic_Unsigned_Addr;

   function Get (Source : in Atomic_Unsigned_Addr)
      return Unsigned_Addr renames Turbo_Private.Atomic.Get;
   function Get (Source : not null access Atomic_Unsigned_Addr)
      return Unsigned_Addr renames Turbo_Private.Atomic.Get;

   function "+" (Source : in Atomic_Unsigned_Addr)
      return Unsigned_Addr renames Get;
   function "+" (Source : not null access Atomic_Unsigned_Addr)
      return Unsigned_Addr renames Get;

   function Lazy_Get (Source : in Atomic_Unsigned_Addr)
      return Unsigned_Addr renames Turbo_Private.Atomic.Lazy_Get;
   function Lazy_Get (Source : not null access Atomic_Unsigned_Addr)
      return Unsigned_Addr renames Turbo_Private.Atomic.Lazy_Get;

   procedure Set (Target : not null access Atomic_Unsigned_Addr;
      Item : Unsigned_Addr) renames Turbo_Private.Atomic.Set;
   procedure Set (Target : in out Atomic_Unsigned_Addr;
      Item : Unsigned_Addr) renames Turbo_Private.Atomic.Set;

   procedure Lazy_Set (Target : not null access Atomic_Unsigned_Addr;
      Item : Unsigned_Addr) renames Turbo_Private.Atomic.Lazy_Set;
   procedure Lazy_Set (Target : in out Atomic_Unsigned_Addr;
      Item : Unsigned_Addr) renames Turbo_Private.Atomic.Lazy_Set;

   function Create (Item : Unsigned_Addr) return Atomic_Unsigned_Addr
      renames Turbo_Private.Atomic.Create;

   function "+" (Item : Unsigned_Addr) return Atomic_Unsigned_Addr
      renames Create;

   function Lazy_Create (Item : Unsigned_Addr) return Atomic_Unsigned_Addr
      renames Turbo_Private.Atomic.Lazy_Create;

   function Swap (Target : not null access Atomic_Unsigned_Addr;
      Item : Unsigned_Addr) return Unsigned_Addr
      renames Turbo_Private.Atomic.Swap;
   
   function Compare_Swap (Target : not null access Atomic_Unsigned_Addr;
      Comparand, New_Item : Unsigned_Addr) return Boolean
      renames Turbo_Private.Atomic.Compare_Swap;
   function Compare_Swap (Target : not null access Atomic_Unsigned_Addr;
      Comparand, New_Item : Unsigned_Addr) return Unsigned_Addr
      renames Turbo_Private.Atomic.Compare_Swap;
   function Compare_Swap (Target : not null access Atomic_Unsigned_Addr;
      Comparand, New_Item : Unsigned_Addr; Fetched : not null access Unsigned_Addr)
      return Boolean renames Turbo_Private.Atomic.Compare_Swap;

   function Inc_Get (Addend : not null access Atomic_Unsigned_Addr)
      return Unsigned_Addr renames Turbo_Private.Atomic.Inc_Get;
   function Get_Inc (Addend : not null access Atomic_Unsigned_Addr)
      return Unsigned_Addr renames Turbo_Private.Atomic.Get_Inc;
   procedure Inc (Addend : in out Atomic_Unsigned_Addr)
      renames Turbo_Private.Atomic.Inc;
   procedure Inc (Addend : not null access Atomic_Unsigned_Addr)
      renames Turbo_Private.Atomic.Inc;

   function Inc_Get (Target : not null access Atomic_Unsigned_Addr;
      Item : Unsigned_Addr) return Unsigned_Addr
      renames Turbo_Private.Atomic.Inc_Get;
   function Get_Inc (Target : not null access Atomic_Unsigned_Addr;
      Item : Unsigned_Addr) return Unsigned_Addr
      renames Turbo_Private.Atomic.Get_Inc;
   procedure Inc (Target : in out Atomic_Unsigned_Addr;
      Item : Unsigned_Addr) renames Turbo_Private.Atomic.Inc;
   procedure Inc (Target : not null access Atomic_Unsigned_Addr;
      Item : Unsigned_Addr) renames Turbo_Private.Atomic.Inc;

   function Dec_Get (Addend : not null access Atomic_Unsigned_Addr)
      return Unsigned_Addr renames Turbo_Private.Atomic.Dec_Get;
   function Get_Dec (Addend : not null access Atomic_Unsigned_Addr)
      return Unsigned_Addr renames Turbo_Private.Atomic.Get_Dec;
   procedure Dec (Addend : in out Atomic_Unsigned_Addr)
      renames Turbo_Private.Atomic.Dec;
   procedure Dec (Addend : not null access Atomic_Unsigned_Addr)
      renames Turbo_Private.Atomic.Dec;

   function Dec_Get (Target : not null access Atomic_Unsigned_Addr;
      Item : Unsigned_Addr) return Unsigned_Addr
      renames Turbo_Private.Atomic.Dec_Get;
   function Get_Dec (Target : not null access Atomic_Unsigned_Addr;
      Item : Unsigned_Addr) return Unsigned_Addr
      renames Turbo_Private.Atomic.Get_Dec;
   procedure Dec (Target : in out Atomic_Unsigned_Addr;
      Item : Unsigned_Addr) renames Turbo_Private.Atomic.Dec;
   procedure Dec (Target : not null access Atomic_Unsigned_Addr;
      Item : Unsigned_Addr) renames Turbo_Private.Atomic.Dec;

   procedure Do_And (Addend : in out Atomic_Unsigned_Addr;
      Item : Unsigned_Addr) renames Turbo_Private.Atomic.Do_And;
   procedure Do_And (Addend : not null access Atomic_Unsigned_Addr;
      Item : Unsigned_Addr) renames Turbo_Private.Atomic.Do_And;

   procedure Do_Or (Addend : in out Atomic_Unsigned_Addr;
      Item : Unsigned_Addr) renames Turbo_Private.Atomic.Do_Or;
   procedure Do_Or (Addend : not null access Atomic_Unsigned_Addr;
      Item : Unsigned_Addr) renames Turbo_Private.Atomic.Do_Or;

   procedure Do_Xor (Addend : in out Atomic_Unsigned_Addr;
      Item : Unsigned_Addr) renames Turbo_Private.Atomic.Do_Xor;
   procedure Do_Xor (Addend : not null access Atomic_Unsigned_Addr;
      Item : Unsigned_Addr) renames Turbo_Private.Atomic.Do_Xor;

end Turbo.Atomic;
