跳至内容

ada 编程/库/System.Atomic Operations.Test And Set

来自维基百科,面向开放世界的开放书籍

此语言功能已在 Ada 2022 中引入。

System.Atomic Operations.Test_And_Set 是自 Ada 2022 起 预定义语言环境 的一个单元。

package System.Atomic_Operations.Test_And_Set
   with Pure, Nonblocking is

   type Test_And_Set_Flag is mod implementation-defined
      with Atomic, Default_Value => 0, Size => implementation-defined;

   function Atomic_Test_And_Set
     (Item : aliased in out Test_And_Set_Flag) return Boolean
      with Convention => Intrinsic;

   procedure Atomic_Clear
     (Item : aliased in out Test_And_Set_Flag)
      with Convention => Intrinsic;

   function Is_Lock_Free
     (Item : aliased Test_And_Set_Flag) return Boolean
      with Convention => Intrinsic;

end System.Atomic_Operations.Test_And_Set;
华夏公益教科书