]> Cypherpunks repositories - gostls13.git/commitdiff
syscall/js: improve documentation of Func.Release
authorRichard Musiol <mail@richard-musiol.de>
Sun, 24 May 2020 17:16:03 +0000 (19:16 +0200)
committerRichard Musiol <neelance@gmail.com>
Sun, 24 May 2020 17:46:52 +0000 (17:46 +0000)
Fixes #38152

Change-Id: I807f49e23cc33e1c9b64029c7504b5a1f81a6bab
Reviewed-on: https://go-review.googlesource.com/c/go/+/235138
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
src/syscall/js/func.go

index 9e99027e9f91d4ff0d8cbfb0b095c5ebd9179c17..da4cf68774ddcd6ebd25aaaf1c93f548595883cb 100644 (file)
@@ -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)