local thread = require("thread") local t -- this example needs an upvalue to t t = thread.create(function() print("start") thread.current():suspend() print("after suspend") os.sleep() print("after sleep") end) print("outside thread create") t:resume() print("after resume")