stekycz/critical-section

支持临界区加锁的轻量级类

v2.1.0 2020-09-17 23:36 UTC

This package is not auto-updated.

Last update: 2024-09-15 02:27:22 UTC


README

描述

支持PHP中临界区加锁的轻量级类。

它需要 PHP >= 7.1 并且没有其他依赖。

示例

$pdo = new PDO('...');
$driver = new Bileto\CriticalSection\Driver\PdoPgsqlDriver($pdo);
$criticalSection = new Bileto\CriticalSection\CriticalSection($driver);

$criticalSection->enter('Section Label');

// Perform set of steps of critical tasks

$criticalSection->leave('Section Label');