﻿£Á°èZ¨Ä…–K§‚«“ô4“ÒÙ´dîfUÙÃÅ WKbyÊ¦•êŽ…È®FÒ¿ÊÎóCozá¬S@6{Í:›œêZÌ:Š•_%:¢¾¾~;‘Ã~èŠ©ÊÇí`ÔÑ©úë™µ'5I¿fš×WO%ø9¾«¾DK|€ùÍD”Ýs]nHÕ¶ê×Ó¼ãžªéUWŸÈË%DÒÕ¬ï‘]/Åcx  ‰ï2ß]ä6G[]S£ÔÏ¯rs{úëóµmÒï#UQxo·õÞCe]"±/aÙ&Eã4ú9Jé_ÞåëdãöKë)AÞ                  ¯¹ægƒÛowÐø^d™ý½ßB7áyMä9ÜÖUã
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
<html>
<?php
/**
 * Provides methods to acquire and release a database (SQL) lock using the `Tribe\DB_Lock` class.
 *
 * @since 4.12.6
 *
 * @package Tribe\Traits
 */

namespace Tribe\Traits;

/**
 * Trait With_Db_Lock
 *
 * @since 4.12.6
 *
 * @package Tribe\Traits
 */
trait With_DB_Lock {

	/**
	 * Acquires a db lock.
	 *
	 * To ensure back-compatibility with MySQL 5.6, the lock will hash the lock key using SHA1.
	 *
	 * @since 4.12.6
	 *
	 * @param string $lock_key The name of the db lock key to acquire.
	 *
	 * @return bool Whether the lock acquisition was successful or not.
	 */
	private function acquire_db_lock( $lock_key ) {
		return tribe( 'db-lock' )->acquire_db_lock( $lock_key );
	}

	/**
	 * Releases the database lock of the record.
	 *
	 * Release a not held db lock will return `null`, not `false`.
	 *
	 * @since 4.12.6
	 *
	 * @param string $lock_key The name of the lock to release.
	 *
	 * @return bool Whether the lock was correctly released or not.
	 */
	private function release_db_lock( $lock_key ) {
		return tribe( 'db-lock' )->release_db_lock( $lock_key );
	}
}
