dumping ground for random patches and texts
 help / color / mirror / Atom feed
* [PATCH] thread.c (rb_thread_alone): simplify
@ 2015-07-17  0:58 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2015-07-17  0:58 UTC (permalink / raw)
  To: spew

This function now also works in more places if ruby_current_thread
is unset.
---
 thread.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/thread.c b/thread.c
index 1e16eb1..1d550ef 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;
 }
 
 /*
-- 
EW


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-07-17  0:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-17  0:58 [PATCH] thread.c (rb_thread_alone): simplify Eric Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).