Skip to content

Commit

Permalink
context: document CancelFunc to be safe for simultaneous use by multi…
Browse files Browse the repository at this point in the history
…ple goroutines

Fixes golang#32145

Change-Id: If4c9dd3a2af748974141ad6e571f80efcbaad772
Reviewed-on: https://go-review.googlesource.com/c/go/+/177899
Reviewed-by: Brad Fitzpatrick <[email protected]>
  • Loading branch information
msoedov authored and bradfitz committed May 20, 2019
1 parent 295c566 commit 82ee4e7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/context/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ func TODO() Context {

// A CancelFunc tells an operation to abandon its work.
// A CancelFunc does not wait for the work to stop.
// A CancelFunc may be called by multiple goroutines simultaneously.
// After the first call, subsequent calls to a CancelFunc do nothing.
type CancelFunc func()

Expand Down

0 comments on commit 82ee4e7

Please sign in to comment.