* 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37863 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
12d48f4ef2
commit
58543f00b6
10
ChangeLog
10
ChangeLog
@ -1,3 +1,13 @@
|
|||||||
|
Mon Nov 26 20:23:20 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
||||||
|
|
||||||
|
* 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@ruby-lang.org>
|
Mon Nov 26 20:23:49 2012 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
* test/ruby/test_argf.rb (TestArgf#test_chars): since marshal data is
|
* test/ruby/test_argf.rb (TestArgf#test_chars): since marshal data is
|
||||||
|
3
signal.c
3
signal.c
@ -624,11 +624,9 @@ static void
|
|||||||
signal_exec(VALUE cmd, int safe, int sig)
|
signal_exec(VALUE cmd, int safe, int sig)
|
||||||
{
|
{
|
||||||
rb_thread_t *cur_th = GET_THREAD();
|
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;
|
volatile unsigned long old_interrupt_mask = cur_th->interrupt_mask;
|
||||||
int state;
|
int state;
|
||||||
|
|
||||||
cur_th->in_trap = 1;
|
|
||||||
cur_th->interrupt_mask |= 0x08;
|
cur_th->interrupt_mask |= 0x08;
|
||||||
TH_PUSH_TAG(cur_th);
|
TH_PUSH_TAG(cur_th);
|
||||||
if ((state = EXEC_TAG()) == 0) {
|
if ((state = EXEC_TAG()) == 0) {
|
||||||
@ -638,7 +636,6 @@ signal_exec(VALUE cmd, int safe, int sig)
|
|||||||
TH_POP_TAG();
|
TH_POP_TAG();
|
||||||
cur_th = GET_THREAD();
|
cur_th = GET_THREAD();
|
||||||
cur_th->interrupt_mask = old_interrupt_mask;
|
cur_th->interrupt_mask = old_interrupt_mask;
|
||||||
cur_th->in_trap = old_in_trap;
|
|
||||||
|
|
||||||
if (state) {
|
if (state) {
|
||||||
/* XXX: should be replaced with rb_threadptr_async_errinfo_enque() */
|
/* XXX: should be replaced with rb_threadptr_async_errinfo_enque() */
|
||||||
|
4
thread.c
4
thread.c
@ -581,7 +581,6 @@ thread_create_core(VALUE thval, VALUE args, VALUE (*fn)(ANYARGS))
|
|||||||
th->async_errinfo_mask_stack = rb_ary_dup(current_th->async_errinfo_mask_stack);
|
th->async_errinfo_mask_stack = rb_ary_dup(current_th->async_errinfo_mask_stack);
|
||||||
RBASIC(th->async_errinfo_mask_stack)->klass = 0;
|
RBASIC(th->async_errinfo_mask_stack)->klass = 0;
|
||||||
|
|
||||||
th->in_trap = 0;
|
|
||||||
th->interrupt_mask = 0;
|
th->interrupt_mask = 0;
|
||||||
|
|
||||||
native_mutex_initialize(&th->interrupt_lock);
|
native_mutex_initialize(&th->interrupt_lock);
|
||||||
@ -811,7 +810,7 @@ thread_join_m(int argc, VALUE *argv, VALUE self)
|
|||||||
double delay = DELAY_INFTY;
|
double delay = DELAY_INFTY;
|
||||||
VALUE limit;
|
VALUE limit;
|
||||||
|
|
||||||
if (cur_th->in_trap) {
|
if (cur_th->interrupt_mask & 0x08) {
|
||||||
rb_raise(rb_eThreadError, "can't be called from trap context");
|
rb_raise(rb_eThreadError, "can't be called from trap context");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4813,7 +4812,6 @@ Init_Thread(void)
|
|||||||
th->async_errinfo_queue_checked = 0;
|
th->async_errinfo_queue_checked = 0;
|
||||||
th->async_errinfo_mask_stack = rb_ary_tmp_new(0);
|
th->async_errinfo_mask_stack = rb_ary_tmp_new(0);
|
||||||
|
|
||||||
th->in_trap = 0;
|
|
||||||
th->interrupt_mask = 0;
|
th->interrupt_mask = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user