New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

adilab/critical-section

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

adilab/critical-section

Critical-section functionality for PHP

Source
Packagist
Version
v1.0.0
Version published
Total downloads
13K
Maintainers
1
Created
Source

Critical-section functionality for PHP

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

API documentacion

FAQs

Package last updated on 16 Apr 2016

Related posts