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