diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2013-04-30 15:50:14 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2013-04-30 15:50:14 +0200 |
commit | 78b0d3e723ab57c2e32b95a66159861fe461d77f (patch) | |
tree | 5085c77ec6d5133d887757fbd87e6065fbe6618b /phpBB | |
parent | 714092ab4e52dc039536a05846b50f4d4d488799 (diff) | |
download | forums-78b0d3e723ab57c2e32b95a66159861fe461d77f.tar forums-78b0d3e723ab57c2e32b95a66159861fe461d77f.tar.gz forums-78b0d3e723ab57c2e32b95a66159861fe461d77f.tar.bz2 forums-78b0d3e723ab57c2e32b95a66159861fe461d77f.tar.xz forums-78b0d3e723ab57c2e32b95a66159861fe461d77f.zip |
[ticket/11495] Use $lock->owns_lock() instead of own property
PHPBB3-11495
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/includes/tree/nestedset.php | 18 |
1 files 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 @@ -56,12 +56,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 * * @param phpbb_db_driver $db Database connection @@ -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; } /** |