diff --git a/thread.c b/thread.c index 7674eff5728736..d40d5140b7d50a 100644 --- a/thread.c +++ b/thread.c @@ -1811,7 +1811,7 @@ rb_thread_io_blocking_call(rb_blocking_function_t *func, void *data1, int fd, in volatile VALUE val = Qundef; /* shouldn't be used */ volatile int saved_errno = 0; enum ruby_tag_type state; - bool prev_mn_schedulable = th->mn_schedulable; + volatile bool prev_mn_schedulable = th->mn_schedulable; th->mn_schedulable = thread_io_mn_schedulable(th, events, NULL); // `errno` is only valid when there is an actual error - but we can't