‪TYPO3CMS  ‪main
TYPO3\CMS\Core\Locking\LockingStrategyInterface Interface Reference
Inheritance diagram for TYPO3\CMS\Core\Locking\LockingStrategyInterface:
TYPO3\CMS\Core\Locking\FileLockStrategy TYPO3\CMS\Core\Locking\SemaphoreLockStrategy TYPO3\CMS\Core\Locking\SimpleLockStrategy TYPO3\CMS\Core\Tests\Unit\Locking\Fixtures\DummyLock

Public Member Functions

 __construct ($subject)
 
bool acquire ($mode=self::LOCK_CAPABILITY_EXCLUSIVE)
 
bool release ()
 
 destroy ()
 
bool isAcquired ()
 

Static Public Member Functions

static int getCapabilities ()
 
static int getPriority ()
 

Public Attributes

const LOCK_CAPABILITY_EXCLUSIVE = 1
 
const LOCK_CAPABILITY_SHARED = 2
 
const LOCK_CAPABILITY_NOBLOCK = 4
 

Detailed Description

Interface for locking methods

Definition at line 25 of file LockingStrategyInterface.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\Locking\LockingStrategyInterface::__construct (   $subject)
Parameters
string$subject‪ID to identify this lock in the system
Exceptions
LockCreateException‪if the lock could not be created

Implemented in TYPO3\CMS\Core\Locking\SemaphoreLockStrategy, TYPO3\CMS\Core\Locking\SimpleLockStrategy, TYPO3\CMS\Core\Locking\FileLockStrategy, and TYPO3\CMS\Core\Tests\Unit\Locking\Fixtures\DummyLock.

Member Function Documentation

◆ acquire()

bool TYPO3\CMS\Core\Locking\LockingStrategyInterface::acquire (   $mode = self::LOCK_CAPABILITY_EXCLUSIVE)

Try to acquire a lock

Parameters
int$mode‪LOCK_CAPABILITY_EXCLUSIVE or LOCK_CAPABILITY_SHARED
Returns
‪bool Returns TRUE if the lock was acquired successfully
Exceptions
LockAcquireException‪if the lock could not be acquired
LockAcquireWouldBlockException‪if the acquire would have blocked and NOBLOCK was set

Implemented in TYPO3\CMS\Core\Locking\SimpleLockStrategy, TYPO3\CMS\Core\Locking\SemaphoreLockStrategy, TYPO3\CMS\Core\Locking\FileLockStrategy, and TYPO3\CMS\Core\Tests\Unit\Locking\Fixtures\DummyLock.

◆ destroy()

TYPO3\CMS\Core\Locking\LockingStrategyInterface::destroy ( )

◆ getCapabilities()

static int TYPO3\CMS\Core\Locking\LockingStrategyInterface::getCapabilities ( )
static

◆ getPriority()

static int TYPO3\CMS\Core\Locking\LockingStrategyInterface::getPriority ( )
static

◆ isAcquired()

bool TYPO3\CMS\Core\Locking\LockingStrategyInterface::isAcquired ( )

Get status of this lock

Returns
‪bool Returns TRUE if lock is acquired by this locker, FALSE otherwise

Implemented in TYPO3\CMS\Core\Locking\FileLockStrategy, TYPO3\CMS\Core\Locking\SimpleLockStrategy, TYPO3\CMS\Core\Locking\SemaphoreLockStrategy, and TYPO3\CMS\Core\Tests\Unit\Locking\Fixtures\DummyLock.

◆ release()

bool TYPO3\CMS\Core\Locking\LockingStrategyInterface::release ( )

Member Data Documentation

◆ LOCK_CAPABILITY_EXCLUSIVE

◆ LOCK_CAPABILITY_NOBLOCK

◆ LOCK_CAPABILITY_SHARED

const TYPO3\CMS\Core\Locking\LockingStrategyInterface::LOCK_CAPABILITY_SHARED = 2