aboutsummaryrefslogtreecommitdiff
path: root/manual
diff options
context:
space:
mode:
Diffstat (limited to 'manual')
-rw-r--r--manual/manual.of36
1 files changed, 26 insertions, 10 deletions
diff --git a/manual/manual.of b/manual/manual.of
index 0d473eed..7c504d97 100644
--- a/manual/manual.of
+++ b/manual/manual.of
@@ -3267,17 +3267,25 @@ when called through this function.
3267 3267
3268Resets a thread, cleaning its call stack and closing all pending 3268Resets a thread, cleaning its call stack and closing all pending
3269to-be-closed variables. 3269to-be-closed variables.
3270Returns a status code: 3270The parameter @id{from} represents the coroutine that is resetting @id{L}.
3271If there is no such coroutine,
3272this parameter can be @id{NULL}.
3273
3274Unless @id{L} is equal to @id{from},
3275the call returns a status code:
3271@Lid{LUA_OK} for no errors in the thread 3276@Lid{LUA_OK} for no errors in the thread
3272(either the original error that stopped the thread or 3277(either the original error that stopped the thread or
3273errors in closing methods), 3278errors in closing methods),
3274or an error status otherwise. 3279or an error status otherwise.
3275In case of error, 3280In case of error,
3276leaves the error object on the top of the stack. 3281the error object is put on the top of the stack.
3277 3282
3278The parameter @id{from} represents the coroutine that is resetting @id{L}. 3283If @id{L} is equal to @id{from},
3279If there is no such coroutine, 3284it corresponds to a thread closing itself.
3280this parameter can be @id{NULL}. 3285In that case,
3286the call does not return;
3287instead, the resume or the protected call
3288that (re)started the thread returns.
3281 3289
3282} 3290}
3283 3291
@@ -6939,18 +6947,26 @@ which come inside the table @defid{coroutine}.
6939See @See{coroutine} for a general description of coroutines. 6947See @See{coroutine} for a general description of coroutines.
6940 6948
6941 6949
6942@LibEntry{coroutine.close (co)| 6950@LibEntry{coroutine.close ([co])|
6943 6951
6944Closes coroutine @id{co}, 6952Closes coroutine @id{co},
6945that is, 6953that is,
6946closes all its pending to-be-closed variables 6954closes all its pending to-be-closed variables
6947and puts the coroutine in a dead state. 6955and puts the coroutine in a dead state.
6948The given coroutine must be dead or suspended. 6956The default for @id{co} is the running coroutine.
6949In case of error 6957
6958The given coroutine must be dead, suspended,
6959or be the running coroutine.
6960For the running coroutine,
6961this function does not return.
6962Instead, the resume that (re)started the coroutine returns.
6963
6964For other coroutines,
6965in case of error
6950(either the original error that stopped the coroutine or 6966(either the original error that stopped the coroutine or
6951errors in closing methods), 6967errors in closing methods),
6952returns @false plus the error object; 6968this function returns @false plus the error object;
6953otherwise returns @true. 6969otherwise ir returns @true.
6954 6970
6955} 6971}
6956 6972