Semaphore.hx 526 B

1234567891011121314151617181920212223
  1. package sys.thread;
  2. abstract Semaphore(hl.Abstract<"hl_semaphore">) {
  3. public function new(value:Int):Void {
  4. this = alloc(value);
  5. }
  6. @:hlNative("std", "semaphore_acquire")
  7. public function acquire():Void {}
  8. @:hlNative("std", "semaphore_release")
  9. public function release():Void {}
  10. @:hlNative("std", "semaphore_try_acquire")
  11. public function tryAcquire(?timeout:Float):Bool {
  12. return false;
  13. }
  14. @:hlNative("std", "semaphore_alloc")
  15. static function alloc(value:Int):hl.Abstract<"hl_semaphore"> {
  16. return null;
  17. }
  18. }