PHP Class Cml\Lock\File

Inheritance: extends Base
显示文件 Open project: linhecheng/cmlphp

Public Methods

Method Description
__destruct ( ) 定义析构函数 自动释放获得的锁
lock ( string $key, boolean $wouldBlock = false ) : mixed 上锁
unlock ( string $key ) 解锁

Private Methods

Method Description
getFileName ( string $key ) : string 获取缓存文件名

Method Details

__destruct() public method

定义析构函数 自动释放获得的锁
public __destruct ( )

lock() public method

上锁
public lock ( string $key, boolean $wouldBlock = false ) : mixed
$key string 要上的锁的key
$wouldBlock boolean 是否堵塞
return mixed

unlock() public method

解锁
public unlock ( string $key )
$key string 要解锁的锁的key