1
0
mirror of https://github.com/danog/parallel.git synced 2025-01-08 13:49:06 +01:00
parallel/src/Sync/MutexInterface.php

21 lines
540 B
PHP

<?php
namespace Icicle\Concurrent\Sync;
/**
* A simple mutex that provides asynchronous, atomic locking and unlocking across
* contexts.
*
* Objects that implement this interface should guarantee that all operations
* are atomic. Implementations do not have to guarantee that acquiring a lock
* is first-come, first serve.
*/
interface MutexInterface
{
/**
* Acquires a lock on the mutex.
*
* @return \Generator Resolves with a lock object when the acquire is successful.
*/
public function acquire();
}