Update function-coroutine-close.md

Clarify dead status and stack clear.
This commit is contained in:
Arseny Kapoulkine 2021-10-29 20:13:54 -07:00 committed by GitHub
parent 132b852a24
commit 41f386b1c0
Signed by: DevComp
GPG key ID: 4AEE18F83AFDEB23

View file

@ -22,6 +22,8 @@ We implement Lua 5.4 behavior exactly with the exception of to-be-closed variabl
The `co` argument must be a coroutine object (of type `thread`). The `co` argument must be a coroutine object (of type `thread`).
After closing the coroutine, it gets transitioned to dead state which means that `coroutine.status` will return `"dead"` and attempts to resume the coroutine will fail. In addition, the coroutine stack (which can be accessed via `debug.traceback` or `debug.info`) will become empty.
## Drawbacks ## Drawbacks
None known, as this function doesn't introduce any existing states to coroutines, and is similar to running the coroutine to completion/error. None known, as this function doesn't introduce any existing states to coroutines, and is similar to running the coroutine to completion/error.