From: Alex Myasoedov Date: Mon, 20 May 2019 15:15:05 +0000 (+0300) Subject: context: document CancelFunc to be safe for simultaneous use by multiple goroutines X-Git-Tag: go1.13beta1~248 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=82ee4e7f78bf34da31e1d050529ab82dc03cf13a;p=gostls13.git context: document CancelFunc to be safe for simultaneous use by multiple goroutines Fixes #32145 Change-Id: If4c9dd3a2af748974141ad6e571f80efcbaad772 Reviewed-on: https://go-review.googlesource.com/c/go/+/177899 Reviewed-by: Brad Fitzpatrick --- diff --git a/src/context/context.go b/src/context/context.go index 0f36881b1e..05d01d0294 100644 --- a/src/context/context.go +++ b/src/context/context.go @@ -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()