From c90997a86ca08b32865377600118d3227b541a73 Mon Sep 17 00:00:00 2001 From: normal Date: Fri, 17 Jul 2015 01:42:18 +0000 Subject: thread.c (rb_thread_alone): simplify This function now also works in more places if ruby_current_thread is unset. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51275 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- thread.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'thread.c') diff --git a/thread.c b/thread.c index 69cd673674..1b726687a0 100644 --- a/thread.c +++ b/thread.c @@ -3048,12 +3048,7 @@ vm_living_thread_num(rb_vm_t *vm) int rb_thread_alone(void) { - int num = 1; - if (!list_empty(&GET_THREAD()->vm->living_threads)) { - num = vm_living_thread_num(GET_THREAD()->vm); - thread_debug("rb_thread_alone: %d\n", num); - } - return num == 1; + return vm_living_thread_num(GET_VM()) == 1; } /* -- cgit v1.2.3