aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/lock
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/phpbb/lock')
-rw-r--r--phpBB/phpbb/lock/db.php11
-rw-r--r--phpBB/phpbb/lock/flock.php7
2 files changed, 16 insertions, 2 deletions
diff --git a/phpBB/phpbb/lock/db.php b/phpBB/phpbb/lock/db.php
index 85ba9a7aa3..7765619422 100644
--- a/phpBB/phpbb/lock/db.php
+++ b/phpBB/phpbb/lock/db.php
@@ -110,7 +110,16 @@ class db
// process we failed to acquire the lock.
$this->locked = $this->config->set_atomic($this->config_name, $lock_value, $this->unique_id, false);
- return $this->locked;
+ if ($this->locked == true)
+ {
+ if ($this->config->ensure_lock($this->config_name, $this->unique_id))
+ {
+ return true;
+ }
+ } else {
+
+ return $this->locked;
+ }
}
/**
diff --git a/phpBB/phpbb/lock/flock.php b/phpBB/phpbb/lock/flock.php
index df88e1490a..89ff7cbe48 100644
--- a/phpBB/phpbb/lock/flock.php
+++ b/phpBB/phpbb/lock/flock.php
@@ -101,7 +101,12 @@ class flock
if ($this->lock_fp)
{
- @flock($this->lock_fp, LOCK_EX);
+ if (@flock($this->lock_fp, LOCK_EX))
+ {
+ return (bool) $this->lock_fp;
+ } else {
+ throw new \phpbb\exception\http_exception(500, 'Failure while aqcuiring locks.');
+ }
}
return (bool) $this->lock_fp;