基础库 2.78.0 开始支持本方法,低版本需做兼容处理,这是一个同步方法。
Worker
Worker.terminate()
// 主线程 const worker = tt.createWorker("workers/index.js"); worker.terminate();