| 1 | <?php |
||
| 11 | class NinjaMutexLockAdapter implements LockAdapterInterface |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * @var LockInterface |
||
| 15 | */ |
||
| 16 | private $ninjaMutexLock; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @var null|int |
||
| 20 | */ |
||
| 21 | private $timeout; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @param LockInterface $ninjaMutexLock |
||
| 25 | * @param null|int $timeout |
||
| 26 | */ |
||
| 27 | public function __construct(LockInterface $ninjaMutexLock, $timeout = null) |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @param string $resourceName |
||
| 35 | * @return bool |
||
| 36 | */ |
||
| 37 | public function acquireLock($resourceName) |
||
| 41 | |||
| 42 | /** |
||
| 43 | * @param string $resourceName |
||
| 44 | * @return bool |
||
| 45 | */ |
||
| 46 | public function releaseLock($resourceName) |
||
| 50 | |||
| 51 | /** |
||
| 52 | * @param string $resourceName |
||
| 53 | * @return bool |
||
| 54 | */ |
||
| 55 | public function isLocked($resourceName) |
||
| 59 | } |
||
| 60 |