diff options
Diffstat (limited to 'process.c')
-rw-r--r-- | process.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -4918,6 +4918,9 @@ rb_f_spawn(int argc, VALUE *argv, VALUE _) * thread calls Thread#run. Called without an argument, sleep() * will sleep forever. * + * If the +duration+ is not supplied, or is +nil+, the thread sleeps forever. + * Threads in this state may still be interrupted by other threads. + * * Time.new #=> 2008-03-08 19:56:19 +0900 * sleep 1.2 #=> 1 * Time.new #=> 2008-03-08 19:56:20 +0900 @@ -4935,7 +4938,7 @@ rb_f_sleep(int argc, VALUE *argv, VALUE _) rb_fiber_scheduler_kernel_sleepv(scheduler, argc, argv); } else { - if (argc == 0) { + if (argc == 0 || (argc == 1 && NIL_P(argv[0]))) { rb_thread_sleep_forever(); } else { |