Config - fix locking issue when already owning the lock [2], fix regression in ed1d8a6260
When not locked loadFromStream() will unlock the file, effectivly leaving us with an unlocked file (but marked as locked).
This commit is contained in:
parent
231a4d48de
commit
a86c0de203
|
@ -786,11 +786,12 @@ class Config extends Singleton
|
|||
{
|
||||
if ($this->config_file_handle !== null) {
|
||||
flock($this->config_file_handle, LOCK_EX);
|
||||
if ($reload && !$this->statusIsLocked) {
|
||||
$do_reload = $reload && !$this->statusIsLocked;
|
||||
$this->statusIsLocked = true;
|
||||
if ($do_reload) {
|
||||
/* Only lock when the exclusive lock wasn't ours yet. */
|
||||
$this->load();
|
||||
}
|
||||
$this->statusIsLocked = true;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue