Semaphore.hx 559 B

123456789101112131415161718192021222324252627282930313233
  1. package eval.luv;
  2. /**
  3. Semaphores.
  4. @see https://aantron.github.io/luv/luv/Luv/Semaphore
  5. **/
  6. @:coreType abstract Semaphore {
  7. /**
  8. Allocates and initializes a read-write lock.
  9. **/
  10. static public function init(value:Int):Result<Semaphore>;
  11. /**
  12. Cleans up a semaphore.
  13. **/
  14. public function destroy():Void;
  15. /**
  16. Increments a semaphore.
  17. **/
  18. public function post():Void;
  19. /**
  20. Decrements a semaphore.
  21. **/
  22. public function wait():Void;
  23. /**
  24. Tries to decrement a semaphore without blocking.
  25. **/
  26. public function tryWait():Result<Result.NoData>;
  27. }