diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-06-03 13:11:20 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-06-03 13:11:20 -0300 |
commit | 514d94274853e6f0dfd6bb2ffa2e1fc64db926dd (patch) | |
tree | e024ebca966e8a84a7997c3908b74bb941dcbd50 /manual | |
parent | 4a3fd8488d617aa633f6b8be85e662653b100a59 (diff) | |
download | lua-github-514d94274853e6f0dfd6bb2ffa2e1fc64db926dd.tar.gz |
'coroutine.kill' renamed 'coroutine.close'
Diffstat (limited to 'manual')
-rw-r--r-- | manual/manual.of | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/manual/manual.of b/manual/manual.of index 687a5b89..eb4e671d 100644 --- a/manual/manual.of +++ b/manual/manual.of @@ -864,7 +864,7 @@ Unlike @Lid{coroutine.resume}, the function created by @Lid{coroutine.wrap} propagates any error to the caller. In this case, -the function also kills the coroutine @seeF{coroutine.kill}. +the function also closes the coroutine @seeF{coroutine.close}. As an example of how coroutines work, consider the following code: @@ -1554,7 +1554,7 @@ Similarly, if a coroutine ends with an error, it does not unwind its stack, so it does not close any variable. You should either use finalizers -or call @Lid{coroutine.kill} to close the variables in these cases. +or call @Lid{coroutine.close} to close the variables in these cases. However, note that if the coroutine was created through @Lid{coroutine.wrap}, then its corresponding function will close all variables @@ -6351,6 +6351,18 @@ which come inside the table @defid{coroutine}. See @See{coroutine} for a general description of coroutines. +@LibEntry{coroutine.close (co)| + +Closes coroutine @id{co}, +that is, +closes all its pending to-be-closed variables +and puts the coroutine in a dead state. +In case of error closing some variable, +returns @false plus the error object; +otherwise returns @true. + +} + @LibEntry{coroutine.create (f)| Creates a new coroutine, with body @id{f}. @@ -6370,17 +6382,6 @@ it is not inside a non-yieldable @N{C function}. } -@LibEntry{coroutine.kill (co)| - -Kills coroutine @id{co}, -closing all its pending to-be-closed variables -and putting the coroutine in a dead state. -In case of error closing some variable, -returns @false plus the error object; -otherwise returns @true. - -} - @LibEntry{coroutine.resume (co [, val1, @Cdots])| Starts or continues the execution of coroutine @id{co}. @@ -6433,7 +6434,7 @@ extra arguments to @id{resume}. The function returns the same values returned by @id{resume}, except the first boolean. In case of error, -the function kills the coroutine and propagates the error. +the function closes the coroutine and propagates the error. } |