Skip to content

Commit 900d43d

Browse files
committed
Fix warning in need_more_shared_native_threads_p
thread_pthread.c:573:20: warning: comparison of unsigned expression in `< 0` is always false [-Wtype-limits] 573 | return snt_cnt < MINIMUM_SNT || (snt_cnt < schedulable_ractor_cnt && snt_cnt < vm->ractor.sched.max_cpu); |
1 parent d5af159 commit 900d43d

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

thread_pthread.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,11 @@ need_more_shared_native_threads_p(rb_vm_t *vm)
570570
if (!vm->ractor.main_ractor->threads.sched.enable_mn_threads) {
571571
schedulable_ractor_cnt--; // do not need snt for main ractor
572572
}
573-
return snt_cnt < MINIMUM_SNT || (snt_cnt < schedulable_ractor_cnt && snt_cnt < vm->ractor.sched.max_cpu);
573+
return
574+
#if MINIMUM_SNT != 0
575+
snt_cnt < MINIMUM_SNT ||
576+
#endif
577+
(snt_cnt < schedulable_ractor_cnt && snt_cnt < vm->ractor.sched.max_cpu);
574578
}
575579

576580
// setup timeslice signals by the timer thread.

0 commit comments

Comments
 (0)