‪TYPO3CMS  10.4
TYPO3\CMS\Core\Locking\ResourceMutex Class Reference

Public Member Functions

 __construct (LockFactory $lockFactory)
 
 acquireLock (string $scope, string $key)
 
 releaseLock (string $scope)
 

Private Attributes

LockFactory $lockFactory
 
LockingStrategyInterface[] $accessLocks = array( )
 
LockingStrategyInterface[] $workerLocks = array( )
 

Detailed Description

Wrapper for locking API that uses two locks to not exhaust locking resources and still block properly

Definition at line 26 of file ResourceMutex.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\Locking\ResourceMutex::__construct ( LockFactory  $lockFactory)

Member Function Documentation

◆ acquireLock()

TYPO3\CMS\Core\Locking\ResourceMutex::acquireLock ( string  $scope,
string  $key 
)

Acquire a specific lock for the given scope

See also
‪\TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::acquireLock
Parameters
string$scope
string$key
Exceptions
LockAcquireException
LockCreateException

Definition at line 58 of file ResourceMutex.php.

References TYPO3\CMS\Core\Locking\LockingStrategyInterface\LOCK_CAPABILITY_EXCLUSIVE, and TYPO3\CMS\Core\Locking\LockingStrategyInterface\LOCK_CAPABILITY_NOBLOCK.

◆ releaseLock()

TYPO3\CMS\Core\Locking\ResourceMutex::releaseLock ( string  $scope)

Release a worker specific lock

Parameters
string$scope
Exceptions
LockAcquireException
LockAcquireWouldBlockException

Definition at line 101 of file ResourceMutex.php.

Member Data Documentation

◆ $accessLocks

LockingStrategyInterface [] TYPO3\CMS\Core\Locking\ResourceMutex::$accessLocks = array( )
private

Access lock

Definition at line 36 of file ResourceMutex.php.

◆ $lockFactory

LockFactory TYPO3\CMS\Core\Locking\ResourceMutex::$lockFactory
private

Definition at line 30 of file ResourceMutex.php.

Referenced by TYPO3\CMS\Core\Locking\ResourceMutex\__construct().

◆ $workerLocks

LockingStrategyInterface [] TYPO3\CMS\Core\Locking\ResourceMutex::$workerLocks = array( )
private

Image processing lock

Definition at line 42 of file ResourceMutex.php.