1
0
mirror of https://github.com/danog/parallel.git synced 2024-12-04 02:27:55 +01:00
parallel/src/Sync/SemaphoreInterface.php

24 lines
443 B
PHP
Raw Normal View History

<?php
namespace Icicle\Concurrent\Sync;
/**
* A counting semaphore interface.
*
* Objects that implement this interface should guarantee that all operations
* are atomic.
*/
interface SemaphoreInterface
{
/**
* Acquires a lock from the semaphore.
*
* Blocks until a lock can be acquired.
*/
public function acquire();
/**
* Releases a lock to the semaphore.
*/
public function release();
}