mirror of
https://github.com/friendica/friendica
synced 2025-01-10 12:44:43 +00:00
e41e7d2edd
- fixed test for semaphore - fixed some issues - changed namespace in Tests back to "src/" - changed namings
46 lines
840 B
PHP
46 lines
840 B
PHP
<?php
|
|
|
|
namespace Friendica\Core\Lock;
|
|
|
|
/**
|
|
* Lock Driver Interface
|
|
*
|
|
* @author Philipp Holzer <admin@philipp.info>
|
|
*/
|
|
interface ILockDriver
|
|
{
|
|
/**
|
|
* Checks, if a key is currently locked to a or my process
|
|
*
|
|
* @param string $key The name of the lock
|
|
* @return bool
|
|
*/
|
|
public function isLocked($key);
|
|
|
|
/**
|
|
*
|
|
* Acquires a lock for a given name
|
|
*
|
|
* @param string $key The Name of the lock
|
|
* @param integer $timeout Seconds until we give up
|
|
*
|
|
* @return boolean Was the lock successful?
|
|
*/
|
|
public function acquireLock($key, $timeout = 120);
|
|
|
|
/**
|
|
* Releases a lock if it was set by us
|
|
*
|
|
* @param string $key The Name of the lock
|
|
*
|
|
* @return void
|
|
*/
|
|
public function releaseLock($key);
|
|
|
|
/**
|
|
* Releases all lock that were set by us
|
|
*
|
|
* @return void
|
|
*/
|
|
public function releaseAll();
|
|
}
|