From 82ee4e7f78bf34da31e1d050529ab82dc03cf13a Mon Sep 17 00:00:00 2001 From: Alex Myasoedov Date: Mon, 20 May 2019 18:15:05 +0300 Subject: [PATCH] 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 --- src/context/context.go | 1 + 1 file changed, 1 insertion(+) 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()