From e7b50dc41b64a5530184f971baa69a20c9ac7937 Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Mon, 8 Nov 2021 13:08:28 -0800 Subject: [PATCH] Update function-coroutine-close.md Clarify behavior when calling coroutine.close repeatedly. --- rfcs/function-coroutine-close.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rfcs/function-coroutine-close.md b/rfcs/function-coroutine-close.md index b3108e7b..354c19d3 100644 --- a/rfcs/function-coroutine-close.md +++ b/rfcs/function-coroutine-close.md @@ -22,7 +22,7 @@ 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. +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. Calling `coroutine.close` on a closed coroutine will return the same information as it returned the first time - that is, `true` if the coroutine was in a non-error state when closed for the first time, and `false` plus the error object otherwise. ## Drawbacks