debug.sethook(x, function() x=debug.getlocal(2,2) coroutine.yield() end, "c")
This sets a call hook, which yields. Relevant documentation: "Hook
functions can yield under the following conditions: Only count and
line events can yield..."
The hook does not successfully yield in this example.
"coroutine.yield()" raises an exception "attempt to yield across a C-call boundary".
The coroutine dies, and the main thread resumes execution.
So either the documentation or the behavior is wrong.
Both are correct: the call hook can not yield.