https://github.com/bileto/criticalsection
Lightweight class supporting critical section locking
https://github.com/bileto/criticalsection
critical-section locks parallel
Last synced: 10 months ago
JSON representation
Lightweight class supporting critical section locking
- Host: GitHub
- URL: https://github.com/bileto/criticalsection
- Owner: bileto
- License: mit
- Created: 2017-03-07T21:53:39.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2022-02-11T20:06:34.000Z (about 4 years ago)
- Last Synced: 2025-04-26T08:48:40.420Z (11 months ago)
- Topics: critical-section, locks, parallel
- Language: PHP
- Size: 55.7 KB
- Stars: 1
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: license.txt
Awesome Lists containing this project
README
# Critical Sections for PHP [](https://travis-ci.org/bileto/CriticalSection)
## Description
Lightweight class supporting critical section locking in PHP.
It requires **PHP >= 7.1** and no other dependency.
## Example
```php
$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');
```