Skip to content

Commit a0a79f0

Browse files
fix: translate change_state comment to bilingual Chinese/English
Agent-Logs-Url: https://github.com/acl-dev/open-coroutine/sessions/cac264ee-7730-4b26-9bd4-dacab5bc93e5 Co-authored-by: loongs-zhang <38336731+loongs-zhang@users.noreply.github.com>
1 parent 9ecd4ea commit a0a79f0

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

core/src/coroutine/state.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ where
1818
new_state: CoroutineState<Yield, Return>,
1919
) -> CoroutineState<Yield, Return> {
2020
let old_state = self.state.replace(new_state);
21-
//先打印日志再通知监听器,确保MonitorListener提交的NOTIFY_NODE时间戳
22-
//在日志输出之后,避免在QEMU等慢速平台上因日志输出耗时超过抢占间隔
23-
//导致协程被反复抢占无法推进的活锁问题
21+
//先打印日志再通知监听器,避免在QEMU等慢速平台上的活锁问题
22+
// Log before notifying listeners so that MonitorListener submits
23+
// the NOTIFY_NODE after the (potentially slow) log I/O completes,
24+
// preventing a preemption live-lock on slow platforms like QEMU.
2425
if let CoroutineState::Error(_) = new_state {
2526
error!("{} {:?}->{:?}", self.name(), old_state, new_state);
2627
} else {

0 commit comments

Comments
 (0)