ruby-changes:13971
From: nobu <ko1@a...>
Date: Mon, 16 Nov 2009 01:11:26 +0900 (JST)
Subject: [ruby-changes:13971] Ruby:r25778 (mvm): * mvm.c (ruby_vm_new): create new vm unless initial vm.
nobu 2009-11-16 01:11:10 +0900 (Mon, 16 Nov 2009) New Revision: 25778 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=25778 Log: * mvm.c (ruby_vm_new): create new vm unless initial vm. * thread.c (thread_start_func_2): ruby_vm_destruct destroys global_vm_lock. Index: mvm.c =================================================================== --- mvm.c (revision 25770) +++ mvm.c (working copy) @@ -28,6 +28,5 @@ ruby_vm_new(int argc, char *argv[]) rb_vm_t *vm = ruby_init(); - if (!vm) return 0; - if (!(vm = ruby_make_bare_vm())) return 0; + if (!vm && !(vm = ruby_make_bare_vm())) return 0; vm->argc = argc; vm->argv = argv; Index: thread.c =================================================================== --- thread.c (revision 25770) +++ thread.c (working copy) @@ -542,9 +542,11 @@ thread_start_func_2(rb_thread_t *th, VAL int signo = 0; ruby_vm_cleanup(th->vm, state, &signo); - if (signo && !ruby_vm_alone()) signo = 0; + if (signo && !ruby_vm_main_p(th->vm)) signo = 0; ruby_vm_destruct(th->vm); if (signo) ruby_default_signal(signo); } - native_mutex_unlock(&th->vm->global_vm_lock); + else { + native_mutex_unlock(&th->vm->global_vm_lock); + } return 0; Modified files: branches/mvm/ChangeLog branches/mvm/mvm.c branches/mvm/thread.c Index: mvm/ChangeLog =================================================================== --- mvm/ChangeLog (revision 25777) +++ mvm/ChangeLog (revision 25778) @@ -1,3 +1,10 @@ +Mon Nov 16 01:11:02 2009 Nobuyoshi Nakada <nobu@r...> + + * mvm.c (ruby_vm_new): create new vm unless initial vm. + + * thread.c (thread_start_func_2): ruby_vm_destruct destroys + global_vm_lock. + Mon Nov 16 01:08:58 2009 Nobuyoshi Nakada <nobu@r...> * thread.c (rb_thread_start_timer_thread), Index: mvm/thread.c =================================================================== --- mvm/thread.c (revision 25777) +++ mvm/thread.c (revision 25778) @@ -541,11 +541,13 @@ if (th->vm->main_thread == th) { int signo = 0; ruby_vm_cleanup(th->vm, state, &signo); - if (signo && !ruby_vm_alone()) signo = 0; + if (signo && !ruby_vm_main_p(th->vm)) signo = 0; ruby_vm_destruct(th->vm); if (signo) ruby_default_signal(signo); } - native_mutex_unlock(&th->vm->global_vm_lock); + else { + native_mutex_unlock(&th->vm->global_vm_lock); + } return 0; } Index: mvm/mvm.c =================================================================== --- mvm/mvm.c (revision 25777) +++ mvm/mvm.c (revision 25778) @@ -27,8 +27,7 @@ { rb_vm_t *vm = ruby_init(); - if (!vm) return 0; - if (!(vm = ruby_make_bare_vm())) return 0; + if (!vm && !(vm = ruby_make_bare_vm())) return 0; vm->argc = argc; vm->argv = argv; vmmgr_add(vm); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/