ruby-changes:39194
From: normal <ko1@a...>
Date: Fri, 17 Jul 2015 10:42:34 +0900 (JST)
Subject: [ruby-changes:39194] normal:r51275 (trunk): thread.c (rb_thread_alone): simplify
normal 2015-07-17 10:42:18 +0900 (Fri, 17 Jul 2015) New Revision: 51275 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=51275 Log: thread.c (rb_thread_alone): simplify This function now also works in more places if ruby_current_thread is unset. Modified files: trunk/ChangeLog trunk/thread.c Index: ChangeLog =================================================================== --- ChangeLog (revision 51274) +++ ChangeLog (revision 51275) @@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Fri Jul 17 09:59:14 2015 Eric Wong <e@8...> + + * thread.c (rb_thread_alone): simplify + Fri Jul 17 09:58:32 2015 Eric Wong <e@8...> * lib/rinda/tuplespace.rb: remove enumerator require Index: thread.c =================================================================== --- thread.c (revision 51274) +++ thread.c (revision 51275) @@ -3048,12 +3048,7 @@ vm_living_thread_num(rb_vm_t *vm) https://github.com/ruby/ruby/blob/trunk/thread.c#L3048 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; } /* -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/