From 37e7f081c4d4c64e13b10787722085407fe5d15f Mon Sep 17 00:00:00 2001 From: Jean de Klerk Date: Mon, 24 Sep 2018 11:15:43 -0700 Subject: [PATCH] semaphore: add more Acquire documentation Change-Id: Ie64db438145a307ec8aef8fd412d445a2fe74d40 Reviewed-on: https://go-review.googlesource.com/c/136995 Reviewed-by: Jonathan Amsterdam Reviewed-by: Brad Fitzpatrick --- semaphore/semaphore.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/semaphore/semaphore.go b/semaphore/semaphore.go index 2096ca3..ac53e73 100644 --- a/semaphore/semaphore.go +++ b/semaphore/semaphore.go @@ -32,9 +32,9 @@ type Weighted struct { waiters list.List } -// Acquire acquires the semaphore with a weight of n, blocking only until ctx -// is done. On success, returns nil. On failure, returns ctx.Err() and leaves -// the semaphore unchanged. +// Acquire acquires the semaphore with a weight of n, blocking until resources +// are available or ctx is done. On success, returns nil. On failure, returns +// ctx.Err() and leaves the semaphore unchanged. // // If ctx is already done, Acquire may still succeed without blocking. func (s *Weighted) Acquire(ctx context.Context, n int64) error {