Skip to content

Commit 37e7f08

Browse files
jeanbzabradfitz
authored andcommitted
semaphore: add more Acquire documentation
Change-Id: Ie64db438145a307ec8aef8fd412d445a2fe74d40 Reviewed-on: https://go-review.googlesource.com/c/136995 Reviewed-by: Jonathan Amsterdam <jba@google.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
1 parent 42b3178 commit 37e7f08

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

semaphore/semaphore.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ type Weighted struct {
3232
waiters list.List
3333
}
3434

35-
// Acquire acquires the semaphore with a weight of n, blocking only until ctx
36-
// is done. On success, returns nil. On failure, returns ctx.Err() and leaves
37-
// the semaphore unchanged.
35+
// Acquire acquires the semaphore with a weight of n, blocking until resources
36+
// are available or ctx is done. On success, returns nil. On failure, returns
37+
// ctx.Err() and leaves the semaphore unchanged.
3838
//
3939
// If ctx is already done, Acquire may still succeed without blocking.
4040
func (s *Weighted) Acquire(ctx context.Context, n int64) error {

0 commit comments

Comments
 (0)