Skip to content

Commit dc7b05f

Browse files
authored
acquire_lock and release_lock should have been private
1 parent 6db2af7 commit dc7b05f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Semaphore.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ private function acquire_fair_with_lock() {
187187
}
188188

189189
// From section 6.2 of the book
190-
public function acquire_lock($acquire_timeout = 10) {
190+
private function acquire_lock($acquire_timeout = 10) {
191191
$identifier = (string)Uuid::uuid4();
192192

193193
$end = time() + $acquire_timeout;
@@ -200,7 +200,7 @@ public function acquire_lock($acquire_timeout = 10) {
200200
}
201201
return false;
202202
}
203-
public function release_lock($id) {
203+
private function release_lock($id) {
204204
$lockname = 'lock:' . $this->name;
205205

206206
$res = $this->client->transaction(['watch' => $lockname, 'cas' => true, 'retry' => 1000], function (MultiExec $t) use ($id, $lockname) {

0 commit comments

Comments
 (0)