class CooperativeWork { steps: Object function run(self: CooperativeWork): Unit { self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() self.steps.increment() } } left = CooperativeWork(ui.state(0)) right = CooperativeWork(ui.state(0)) leftTask = ui.spawn(left,"work",left.run) rightTask = ui.spawn(right,"work",right.run) leftStatus = TextBlock("") rightStatus = TextBlock("") leftStatus.bind("text",leftTask.status) rightStatus.bind("text",rightTask.status) page = Page() page.title = "独立暂停调用" page.render(Column(24,16,TextBlock("两个任务分别保存执行帧;在 REPL 查看 left.steps.value / right.steps.value",2),leftStatus,rightStatus))