fiber: bugfix unexpect exit

无IO协程时调度器异常退出 (win/linux)

复现步骤: 创建一个协程, 进行几个IO操作, 然后死循环 acl_fiber_delay(1000)
This commit is contained in:
Sid 2022-05-06 02:33:51 +08:00 committed by GitHub
parent 39b11013d2
commit 4801b5c8ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -215,6 +215,13 @@ static void fiber_io_loop(ACL_FIBER *self fiber_unused, void *ctx)
} else if (ring_size(&ev->events) > 0) {
continue;
}
// only sleep fiber alive ?
timer = FIRST_FIBER(&__thread_fiber->ev_timer);
if (timer) {
continue;
}
msg_info("%s(%d), tid=%lu: fdcount=0, waiter=%u, events=%d",
__FUNCTION__, __LINE__, __pthread_self(),
ev->waiter, ring_size(&ev->events));