summaryrefslogtreecommitdiff
path: root/src/syscall/js
diff options
context:
space:
mode:
authorRichard Musiol <mail@richard-musiol.de>2020-05-24 19:16:03 +0200
committerRichard Musiol <neelance@gmail.com>2020-05-24 17:46:52 +0000
commit828bb0c123af11d21c82eb87b64dfa9af24858c7 (patch)
tree93848c9382242afc4fe9b2ea17d635980431cabd /src/syscall/js
parent8194187a2de9b693af6656ca956762437c2f9c64 (diff)
downloadgo-git-828bb0c123af11d21c82eb87b64dfa9af24858c7.tar.gz
syscall/js: improve documentation of Func.Release
Fixes #38152 Change-Id: I807f49e23cc33e1c9b64029c7504b5a1f81a6bab Reviewed-on: https://go-review.googlesource.com/c/go/+/235138 Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Diffstat (limited to 'src/syscall/js')
-rw-r--r--src/syscall/js/func.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/syscall/js/func.go b/src/syscall/js/func.go
index 9e99027e9f..da4cf68774 100644
--- a/src/syscall/js/func.go
+++ b/src/syscall/js/func.go
@@ -39,7 +39,7 @@ type Func struct {
// immediate deadlock. Therefore a blocking function should explicitly start a
// new goroutine.
//
-// Func.Release must be called to free up resources when the function will not be used any more.
+// Func.Release must be called to free up resources when the function will not be invoked any more.
func FuncOf(fn func(this Value, args []Value) interface{}) Func {
funcsMu.Lock()
id := nextFuncID
@@ -54,6 +54,7 @@ func FuncOf(fn func(this Value, args []Value) interface{}) Func {
// Release frees up resources allocated for the function.
// The function must not be invoked after calling Release.
+// It is allowed to call Release while the function is still running.
func (c Func) Release() {
funcsMu.Lock()
delete(funcs, c.id)