mirror of
https://github.com/danog/parallel.git
synced 2024-12-11 16:49:51 +01:00
24 lines
621 B
PHP
24 lines
621 B
PHP
<?php
|
|
namespace Icicle\Concurrent\Sync;
|
|
|
|
/**
|
|
* A non-blocking synchronization primitive that can be used for mutual exclusion 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
|
|
{
|
|
/**
|
|
* @coroutine
|
|
*
|
|
* Acquires a lock on the mutex.
|
|
*
|
|
* @return \Generator Resolves with a lock object when the acquire is successful.
|
|
*
|
|
* @resolve \Icicle\Concurrent\Sync\Lock
|
|
*/
|
|
public function acquire();
|
|
}
|