執行緒模組 (thread)執行緒模組 (thread) thread 模組基於 Lua 自帶的協程(coroutine)實現,並非通常意義上的多執行緒。 派發一個任務 (thread.dispatch) 取得目前任務的 ID (thread.current_id) 從隊列中移除一項任務 (thread.kill) 阻塞等待另一個任務完成 (thread.wait) 註冊監聽一個事件 (thread.register_event) 反註冊監聽一個事件 (thread.unregister_event) thread 範例代碼