From 41f386b1c0c102fb80cb389ab148399ce30f2aa0 Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Fri, 29 Oct 2021 20:13:54 -0700 Subject: [PATCH] Update function-coroutine-close.md Clarify dead status and stack clear. --- rfcs/function-coroutine-close.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rfcs/function-coroutine-close.md b/rfcs/function-coroutine-close.md index a7765fff..b3108e7b 100644 --- a/rfcs/function-coroutine-close.md +++ b/rfcs/function-coroutine-close.md @@ -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`). +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 None known, as this function doesn't introduce any existing states to coroutines, and is similar to running the coroutine to completion/error.