ruby-changes:25806
From: kosaki <ko1@a...>
Date: Mon, 26 Nov 2012 20:45:51 +0900 (JST)
Subject: [ruby-changes:25806] kosaki:r37863 (trunk): * thread.c (thread_join_m): use th->interrupt_mask instead of
kosaki 2012-11-26 20:45:39 +0900 (Mon, 26 Nov 2012) New Revision: 37863 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=37863 Log: * thread.c (thread_join_m): use th->interrupt_mask instead of th->in_trap. * vm_core.h (struct rb_thread_struct): remove in_trap member. * signal.c (signal_exec): ditto. * thread.c (thread_create_core): ditto. * thread.c (Init_Thread): ditto. Modified files: trunk/ChangeLog trunk/signal.c trunk/thread.c trunk/vm_core.h Index: ChangeLog =================================================================== --- ChangeLog (revision 37862) +++ ChangeLog (revision 37863) @@ -1,3 +1,13 @@ +Mon Nov 26 20:23:20 2012 KOSAKI Motohiro <kosaki.motohiro@g...> + + * thread.c (thread_join_m): use th->interrupt_mask instead of + th->in_trap. + + * vm_core.h (struct rb_thread_struct): remove in_trap member. + * signal.c (signal_exec): ditto. + * thread.c (thread_create_core): ditto. + * thread.c (Init_Thread): ditto. + Mon Nov 26 20:23:49 2012 NAKAMURA Usaku <usa@r...> * test/ruby/test_argf.rb (TestArgf#test_chars): since marshal data is Index: vm_core.h =================================================================== --- vm_core.h (revision 37862) +++ vm_core.h (revision 37863) @@ -585,9 +585,6 @@ void *altstack; #endif unsigned long running_time_us; - - /* 1 if running trap handler */ - int in_trap; } rb_thread_t; /* iseq.c */ Index: thread.c =================================================================== --- thread.c (revision 37862) +++ thread.c (revision 37863) @@ -581,7 +581,6 @@ th->async_errinfo_mask_stack = rb_ary_dup(current_th->async_errinfo_mask_stack); RBASIC(th->async_errinfo_mask_stack)->klass = 0; - th->in_trap = 0; th->interrupt_mask = 0; native_mutex_initialize(&th->interrupt_lock); @@ -811,7 +810,7 @@ double delay = DELAY_INFTY; VALUE limit; - if (cur_th->in_trap) { + if (cur_th->interrupt_mask & 0x08) { rb_raise(rb_eThreadError, "can't be called from trap context"); } @@ -4813,7 +4812,6 @@ th->async_errinfo_queue_checked = 0; th->async_errinfo_mask_stack = rb_ary_tmp_new(0); - th->in_trap = 0; th->interrupt_mask = 0; } } Index: signal.c =================================================================== --- signal.c (revision 37862) +++ signal.c (revision 37863) @@ -624,11 +624,9 @@ signal_exec(VALUE cmd, int safe, int sig) { rb_thread_t *cur_th = GET_THREAD(); - volatile int old_in_trap = cur_th->in_trap; volatile unsigned long old_interrupt_mask = cur_th->interrupt_mask; int state; - cur_th->in_trap = 1; cur_th->interrupt_mask |= 0x08; TH_PUSH_TAG(cur_th); if ((state = EXEC_TAG()) == 0) { @@ -638,7 +636,6 @@ TH_POP_TAG(); cur_th = GET_THREAD(); cur_th->interrupt_mask = old_interrupt_mask; - cur_th->in_trap = old_in_trap; if (state) { /* XXX: should be replaced with rb_threadptr_async_errinfo_enque() */ -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/