adilab/critical-section
最新稳定版本:v1.0.0
Composer 安装命令:
composer require adilab/critical-section
包简介
Critical-section functionality for PHP
README 文档
README
Allows create a critical section of code where only determine number of process can enter.
Installing
Preferred way to install is with Composer.
Install this library using composer:
$ composer require adilab/critical-section
Usage:
Usage in order to check if the process can entry into critical section.
require('vendor/autoload.php'); use Adi\System\CriticalSection; $cs = new CriticalSection(); if (!$cs->hasAccess()) die("There are other process in executing...\n"); echo "Processing...\n"; $cs = NULL; // Destructs (closes) the critical section.
The process can wait to of the performance critical section by other processes.
require('vendor/autoload.php'); use Adi\System\CriticalSection; $cs = new CriticalSection(); $cs->waitAccess(); echo "Processing...\n";
Documentation
统计信息
- 总下载量: 9.69k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-04-16