aboutsummaryrefslogtreecommitdiff
path: root/manual
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-06-03 13:11:20 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-06-03 13:11:20 -0300
commit514d94274853e6f0dfd6bb2ffa2e1fc64db926dd (patch)
treee024ebca966e8a84a7997c3908b74bb941dcbd50 /manual
parent4a3fd8488d617aa633f6b8be85e662653b100a59 (diff)
downloadlua-514d94274853e6f0dfd6bb2ffa2e1fc64db926dd.tar.gz
lua-514d94274853e6f0dfd6bb2ffa2e1fc64db926dd.tar.bz2
lua-514d94274853e6f0dfd6bb2ffa2e1fc64db926dd.zip
'coroutine.kill' renamed 'coroutine.close'
Diffstat (limited to 'manual')
-rw-r--r--manual/manual.of29
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},
864the function created by @Lid{coroutine.wrap} 864the function created by @Lid{coroutine.wrap}
865propagates any error to the caller. 865propagates any error to the caller.
866In this case, 866In this case,
867the function also kills the coroutine @seeF{coroutine.kill}. 867the function also closes the coroutine @seeF{coroutine.close}.
868 868
869As an example of how coroutines work, 869As an example of how coroutines work,
870consider the following code: 870consider the following code:
@@ -1554,7 +1554,7 @@ Similarly, if a coroutine ends with an error,
1554it does not unwind its stack, 1554it does not unwind its stack,
1555so it does not close any variable. 1555so it does not close any variable.
1556You should either use finalizers 1556You should either use finalizers
1557or call @Lid{coroutine.kill} to close the variables in these cases. 1557or call @Lid{coroutine.close} to close the variables in these cases.
1558However, note that if the coroutine was created 1558However, note that if the coroutine was created
1559through @Lid{coroutine.wrap}, 1559through @Lid{coroutine.wrap},
1560then its corresponding function will close all variables 1560then its corresponding function will close all variables
@@ -6351,6 +6351,18 @@ which come inside the table @defid{coroutine}.
6351See @See{coroutine} for a general description of coroutines. 6351See @See{coroutine} for a general description of coroutines.
6352 6352
6353 6353
6354@LibEntry{coroutine.close (co)|
6355
6356Closes coroutine @id{co},
6357that is,
6358closes all its pending to-be-closed variables
6359and puts the coroutine in a dead state.
6360In case of error closing some variable,
6361returns @false plus the error object;
6362otherwise returns @true.
6363
6364}
6365
6354@LibEntry{coroutine.create (f)| 6366@LibEntry{coroutine.create (f)|
6355 6367
6356Creates a new coroutine, with body @id{f}. 6368Creates a new coroutine, with body @id{f}.
@@ -6370,17 +6382,6 @@ it is not inside a non-yieldable @N{C function}.
6370 6382
6371} 6383}
6372 6384
6373@LibEntry{coroutine.kill (co)|
6374
6375Kills coroutine @id{co},
6376closing all its pending to-be-closed variables
6377and putting the coroutine in a dead state.
6378In case of error closing some variable,
6379returns @false plus the error object;
6380otherwise returns @true.
6381
6382}
6383
6384@LibEntry{coroutine.resume (co [, val1, @Cdots])| 6385@LibEntry{coroutine.resume (co [, val1, @Cdots])|
6385 6386
6386Starts or continues the execution of coroutine @id{co}. 6387Starts or continues the execution of coroutine @id{co}.
@@ -6433,7 +6434,7 @@ extra arguments to @id{resume}.
6433The function returns the same values returned by @id{resume}, 6434The function returns the same values returned by @id{resume},
6434except the first boolean. 6435except the first boolean.
6435In case of error, 6436In case of error,
6436the function kills the coroutine and propagates the error. 6437the function closes the coroutine and propagates the error.
6437 6438
6438} 6439}
6439 6440