mirror of
https://github.com/friendica/friendica
synced 2025-04-30 00:24:24 +02:00
Database locks are now having its very own functions
This commit is contained in:
parent
5de03c1b27
commit
d2cb87a200
2 changed files with 24 additions and 2 deletions
|
@ -34,7 +34,7 @@ class Lock {
|
|||
$start = time();
|
||||
|
||||
do {
|
||||
dba::p("LOCK TABLE `locks` WRITE");
|
||||
dba::lock('locks');
|
||||
$lock = dba::select('locks', array('locked', 'pid'), array('name' => $fn_name), array('limit' => 1));
|
||||
|
||||
if (dbm::is_result($lock)) {
|
||||
|
@ -57,7 +57,7 @@ class Lock {
|
|||
$got_lock = true;
|
||||
}
|
||||
|
||||
dba::p("UNLOCK TABLES");
|
||||
dba::unlock();
|
||||
|
||||
if (!$got_lock) {
|
||||
sleep($wait_sec);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue