From 78b0d3e723ab57c2e32b95a66159861fe461d77f Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 30 Apr 2013 15:50:14 +0200 Subject: [PATCH] [ticket/11495] Use $lock->owns_lock() instead of own property PHPBB3-11495 --- phpBB/includes/tree/nestedset.php | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/phpBB/includes/tree/nestedset.php b/phpBB/includes/tree/nestedset.php index 6819f9791b..26152e6c10 100644 --- a/phpBB/includes/tree/nestedset.php +++ b/phpBB/includes/tree/nestedset.php @@ -55,12 +55,6 @@ abstract class phpbb_tree_nestedset implements phpbb_tree_interface */ protected $item_basic_data = array('*'); - /** - * Does the class currently have a lock on the item table? - * @var bool - */ - protected $lock_acquired = false; - /** * Construct * @@ -114,7 +108,7 @@ abstract class phpbb_tree_nestedset implements phpbb_tree_interface */ protected function acquire_lock() { - if ($this->lock_acquired) + if ($this->lock->owns_lock()) { return false; } @@ -124,25 +118,17 @@ abstract class phpbb_tree_nestedset implements phpbb_tree_interface throw new RuntimeException($this->message_prefix . 'LOCK_FAILED_ACQUIRE'); } - $this->lock_acquired = true; return true; } /** * Releases the lock on the item table * - * @return bool False, if there was no lock to release, true otherwise + * @return null */ protected function release_lock() { - if (!$this->lock_acquired) - { - return false; - } - $this->lock->release(); - $this->lock_acquired = false; - return true; } /**