Fix Locks

- Wrong return of lock releasing with DBA provider
- It's not possible to maintain Semaphore locks, since they aren't accessible by other processes
Should solve https://github.com/friendica/friendica/issues/7298#issuecomment-521996540
This commit is contained in:
Philipp Holzer 2019-08-17 19:33:36 +02:00
parent e8561b480b
commit c803dcb6c5
No known key found for this signature in database
GPG key ID: D8365C3D36B77D90
4 changed files with 74 additions and 48 deletions

View file

@ -82,7 +82,11 @@ class DatabaseLock extends Lock
$where = ['name' => $key, 'pid' => $this->pid];
}
$return = $this->dba->delete('locks', $where);
if ($this->dba->exists('locks', $where)) {
$return = $this->dba->delete('locks', $where);
} else {
$return = false;
}
$this->markRelease($key);
@ -105,7 +109,7 @@ class DatabaseLock extends Lock
$this->acquiredLocks = [];
return $return;
return $return && $success;
}
/**