oth. get_original_thread Synchronous
Read the coroutine that made the intercepted call from inside an OTH callback. Use it when callback diagnostics need to identify the caller.
Luau
oth.get_original_thread() -> thread?Parameters
This function takes no arguments.
Returns
thread?The original calling thread inside an OTH callback, or nil outside one.
Usage notes
This is a thread reference, not a request to resume or schedule that thread.
Example
Luau
local target = newcclosure(function() return true end)
local previous = oth.hook(target, function()
print("Caller thread:", oth.get_original_thread())
return true
end)
target()
oth.unhook(target, previous)