diff options
author | Oleg Pudeyev <oleg@bsdpower.com> | 2012-12-04 02:00:27 -0500 |
---|---|---|
committer | Oleg Pudeyev <oleg@bsdpower.com> | 2012-12-04 02:00:27 -0500 |
commit | 4010f4085aa56f20fd95274ecfc2fe7404f98269 (patch) | |
tree | 390becea4b8f1d0e395f05b991be61b9d341f36d /phpBB/includes | |
parent | f08c28c77a585e35cc17a2248ba61428275ccdd7 (diff) | |
download | forums-4010f4085aa56f20fd95274ecfc2fe7404f98269.tar forums-4010f4085aa56f20fd95274ecfc2fe7404f98269.tar.gz forums-4010f4085aa56f20fd95274ecfc2fe7404f98269.tar.bz2 forums-4010f4085aa56f20fd95274ecfc2fe7404f98269.tar.xz forums-4010f4085aa56f20fd95274ecfc2fe7404f98269.zip |
[ticket/10103] Use flock lock class in messenger.
PHPBB3-10103
Diffstat (limited to 'phpBB/includes')
-rw-r--r-- | phpBB/includes/functions_messenger.php | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index 503f419e5a..56fc7e628f 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -658,13 +658,14 @@ class queue { global $db, $config, $phpEx, $phpbb_root_path, $user; - $lock_fp = $this->lock(); + $lock = new phpbb_lock_flock($this->cache_file); + $lock->acquire(); set_config('last_queue_run', time(), true); if (!file_exists($this->cache_file) || filemtime($this->cache_file) > time() - $config['queue_interval']) { - $this->unlock($lock_fp); + $lock->release(); return; } @@ -731,7 +732,7 @@ class queue break; default: - $this->unlock($lock_fp); + $lock->release(); return; } @@ -807,7 +808,7 @@ class queue } } - $this->unlock($lock_fp); + $lock->release(); } /** @@ -820,7 +821,8 @@ class queue return; } - $lock_fp = $this->lock(); + $lock = new phpbb_lock_flock($this->cache_file); + $lock->acquire(); if (file_exists($this->cache_file)) { @@ -847,7 +849,7 @@ class queue phpbb_chmod($this->cache_file, CHMOD_READ | CHMOD_WRITE); } - $this->unlock($lock_fp); + $lock->release(); } } |