|
Been trying to debug a strange locking issue in send mode and found that mlua seems to hold a lock around lua across en entire Thread::resume call. Won't this lead to issues if another thread tries to perform operations on the lua VM while in a lua thread resume [aka, shouldnt mlua release the lock before the resume and then relock or am I not seeing it correctly] |
Answered by
khvzak
Jul 20, 2025
Replies: 1 comment 3 replies
|
The main purpose of the lock is to protect Lua VM. If release the lock before |
3 replies
Answer selected by
cheesycod
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The main purpose of the lock is to protect Lua VM. If release the lock before
Thread::resumecall, then another thread waiting for the lock will acquire it, get access to the VM and can execute any operations. Such scenario is not supported by Lua and will cause UB.