Skip to content

Commit

Permalink
MN: skip waiting on fiber schedulers
Browse files Browse the repository at this point in the history
If the Fiber is nonblocking mode, fiber scheduler needs to handle
IO events.
  • Loading branch information
ko1 committed Dec 22, 2023
1 parent 4149fb4 commit cb2f0c1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit cb2f0c1

Please sign in to comment.