LockInterface.php 565 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: Jenner
  5. * Date: 2015/8/21
  6. * Time: 14:24
  7. */
  8. namespace Jenner\SimpleFork\Lock;
  9. /**
  10. * lock for processes to mutual exclusion
  11. *
  12. * @package Jenner\SimpleFork\Lock
  13. */
  14. interface LockInterface
  15. {
  16. /**
  17. * get a lock
  18. *
  19. * @param bool $blocking
  20. * @return bool
  21. */
  22. public function acquire($blocking = true);
  23. /**
  24. * release lock
  25. *
  26. * @return bool
  27. */
  28. public function release();
  29. /**
  30. * is locked
  31. *
  32. * @return bool
  33. */
  34. public function isLocked();
  35. }