mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
3e5c21f7cb
commit
3ee156c7a3
2 changed files with 5 additions and 6 deletions
|
@ -1,3 +1,7 @@
|
|||
Fri Jul 17 09:59:14 2015 Eric Wong <e@80x24.org>
|
||||
|
||||
* thread.c (rb_thread_alone): simplify
|
||||
|
||||
Fri Jul 17 09:58:32 2015 Eric Wong <e@80x24.org>
|
||||
|
||||
* lib/rinda/tuplespace.rb: remove enumerator require
|
||||
|
|
7
thread.c
7
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;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Reference in a new issue