Forcing a Lua script to exit

后端 未结 10 1024
长情又很酷
长情又很酷 2020-12-23 18:49

How do you end a long running Lua script?

I have two threads, one runs the main program and the other controls a user supplied Lua script. I need to kill the thread

10条回答
  •  天命终不由人
    2020-12-23 19:03

    The way to end a script is to raise an error by calling error. However, if the user has called the script via pcall then this error will be caught.

提交回复
热议问题