summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authorKoichi Sasada <[email protected]>2023-12-23 07:46:56 +0900
committerKoichi Sasada <[email protected]>2023-12-23 08:10:41 +0900
commitfa5de8f68d51e4fbc91190061e3ce3817bd68964 (patch)
treeda1abd369b28f670e28db437723938e2217531c3 /thread.c
parentbeec3d07c907ec875e05fe2d22cea2263857b499 (diff)
MN: skip waiting on fiber schedulers
If the Fiber is nonblocking mode, fiber scheduler needs to handle IO events.
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/thread.c b/thread.c
index da55879824..ed71102007 100644
--- a/thread.c
+++ b/thread.c
@@ -1691,7 +1691,10 @@ static int
thread_io_wait_events(rb_thread_t *th, rb_execution_context_t *ec, int fd, int events, struct timeval *timeout, struct waiting_fd *wfd)
{
#if defined(USE_MN_THREADS) && USE_MN_THREADS
- if (!th_has_dedicated_nt(th) && (events || timeout)) {
+ if (!th_has_dedicated_nt(th) &&
+ (events || timeout) &&
+ th->blocking // no fiber scheduler
+ ) {
int r;
rb_hrtime_t rel, *prel;