summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-17 01:42:18 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-17 01:42:18 +0000
commit3ee156c7a39af290104c842cafb13aa985ed28c5 (patch)
treed22b4270f73ed4ddba58fafd4cc4768256b01b5a /thread.c
parent3e5c21f7cb1e8766da7e02ddb2e081b1796f9c3d (diff)
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
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c7
1 files changed, 1 insertions, 6 deletions
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;
}
/*