From afa726d69f33054d9aeae44f84cc687b63d818ef Mon Sep 17 00:00:00 2001 From: Aaron Piotrowski Date: Wed, 29 Nov 2017 12:47:56 -0600 Subject: [PATCH] Clarify resolution and failure values --- lib/Mutex.php | 3 ++- lib/Semaphore.php | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/Mutex.php b/lib/Mutex.php index afea8d5..8c5b10b 100644 --- a/lib/Mutex.php +++ b/lib/Mutex.php @@ -15,7 +15,8 @@ interface Mutex { /** * Acquires a lock on the mutex. * - * @return \Amp\Promise<\Amp\Sync\Lock> Resolves with a lock object with an ID of 0 when the acquire is successful. + * @return \Amp\Promise<\Amp\Sync\Lock> Resolves with a lock object with an ID of 0. May fail with a SyncException + * if an error occurs when attempting to obtain the lock (e.g. a shared memory segment closed). */ public function acquire(): Promise; } diff --git a/lib/Semaphore.php b/lib/Semaphore.php index 49f790d..1b1c052 100644 --- a/lib/Semaphore.php +++ b/lib/Semaphore.php @@ -15,9 +15,9 @@ interface Semaphore { /** * Acquires a lock on the semaphore. * - * @return \Amp\Promise<\Amp\Sync\Lock> Resolves with an integer keyed lock object when the acquire is - * successful. Identifiers returned by the locks should be 0-indexed. Releasing an idenifier MUST make that same - * identifier available. + * @return \Amp\Promise<\Amp\Sync\Lock> Resolves with an integer keyed lock object. Identifiers returned by the + * locks should be 0-indexed. Releasing an identifier MUST make that same identifier available. May fail with + * a SyncException if an error occurs when attempting to obtain the lock (e.g. a shared memory segment closed). */ public function acquire(): Promise; }