AtomicInt.hx 536 B

123456789101112131415161718
  1. package cpp;
  2. @:scalar @:coreType
  3. extern abstract AtomicInt from(Int) to(Int)
  4. {
  5. // returns true if exchange took place
  6. @:native("_hx_atomic_exchange_if")
  7. public static function exchangeIf(ioValue:Pointer<AtomicInt>, test:Int, newVal:Int) : Bool;
  8. // returns value before increment
  9. @:native("_hx_atomic_inc")
  10. public static function atomicInc(ioValue:Pointer<AtomicInt>) : Int;
  11. // returns value before decrement
  12. @:native("_hx_atomic_dec")
  13. public static function atomicDec(ioValue:Pointer<AtomicInt>) : Int;
  14. }