1 | <?php |
||
7 | class NullMutex implements MutexInterface |
||
8 | { |
||
9 | /** |
||
10 | * @var bool |
||
11 | */ |
||
12 | private $acquired = false; |
||
13 | |||
14 | /** |
||
15 | * @see \MetaborStd\Semaphore\MutexInterface::releaseLock() |
||
16 | */ |
||
17 | 3 | public function releaseLock() |
|
18 | { |
||
19 | 3 | $this->acquired = false; |
|
20 | |||
21 | 3 | return true; |
|
22 | } |
||
23 | |||
24 | /** |
||
25 | * @see \MetaborStd\Semaphore\MutexInterface::isAcquired() |
||
26 | */ |
||
27 | 3 | public function isAcquired() |
|
28 | { |
||
29 | 3 | return $this->acquired; |
|
30 | } |
||
31 | |||
32 | /** |
||
33 | * @see \MetaborStd\Semaphore\MutexInterface::acquireLock() |
||
34 | */ |
||
35 | 3 | public function acquireLock() |
|
36 | { |
||
37 | 3 | $this->acquired = true; |
|
38 | |||
39 | 3 | return true; |
|
40 | } |
||
41 | |||
42 | /** |
||
43 | * @see \MetaborStd\Semaphore\MutexInterface::isLocked() |
||
44 | */ |
||
45 | public function isLocked() |
||
49 | } |
||
50 |