db = $db; $this->lock = $lock; $this->table_name = $table_name; } /** * @inheritdoc */ public function move_children(array $current_parent, array $new_parent) { while (!$this->lock->acquire()) { // Retry after 0.2 seconds usleep(200 * 1000); } try { $return = parent::move_children($current_parent, $new_parent); } catch (phpbb_nestedset_exception $e) { $this->lock->release(); throw new phpbb_nestedset_exception('FORUM_NESTEDSET_' . $e->getMessage()); } $this->lock->release(); return $return; } /** * @inheritdoc */ public function set_parent(array $item, array $new_parent) { while (!$this->lock->acquire()) { // Retry after 0.2 seconds usleep(200 * 1000); } try { $return = parent::set_parent($item, $new_parent); } catch (phpbb_nestedset_exception $e) { $this->lock->release(); throw new phpbb_nestedset_exception('FORUM_NESTEDSET_' . $e->getMessage()); } $this->lock->release(); return $return; } }