[前][次][番号順一覧][スレッド一覧]

ruby-changes:48577

From: ko1 <ko1@a...>
Date: Tue, 7 Nov 2017 15:09:52 +0900 (JST)
Subject: [ruby-changes:48577] ko1:r60692 (trunk): th->ec: rb_threadptr_setup_exception

ko1	2017-11-07 15:09:47 +0900 (Tue, 07 Nov 2017)

  New Revision: 60692

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60692

  Log:
    th->ec: rb_threadptr_setup_exception
    
    * eval.c (rb_threadptr_setup_exception): renamed to rb_ec_setup_exception().

  Modified files:
    trunk/eval.c
    trunk/thread.c
    trunk/vm_core.h
Index: vm_core.h
===================================================================
--- vm_core.h	(revision 60691)
+++ vm_core.h	(revision 60692)
@@ -1498,6 +1498,7 @@ VALUE rb_iseq_pathobj_new(VALUE path, VA https://github.com/ruby/ruby/blob/trunk/vm_core.h#L1498
 void rb_iseq_pathobj_set(const rb_iseq_t *iseq, VALUE path, VALUE realpath);
 
 int rb_ec_frame_method_id_and_class(const rb_execution_context_t *ec, ID *idp, ID *called_idp, VALUE *klassp);
+void rb_ec_setup_exception(const rb_execution_context_t *ec, VALUE mesg, VALUE cause);
 
 VALUE rb_vm_invoke_proc(rb_execution_context_t *ec, rb_proc_t *proc, int argc, const VALUE *argv, VALUE block_handler);
 VALUE rb_vm_make_proc_lambda(const rb_execution_context_t *ec, const struct rb_captured_block *captured, VALUE klass, int8_t is_lambda);
Index: thread.c
===================================================================
--- thread.c	(revision 60691)
+++ thread.c	(revision 60692)
@@ -2112,14 +2112,12 @@ rb_threadptr_ready(rb_thread_t *th) https://github.com/ruby/ruby/blob/trunk/thread.c#L2112
     rb_threadptr_interrupt(th);
 }
 
-void rb_threadptr_setup_exception(rb_thread_t *th, VALUE mesg, VALUE cause);
-
 static VALUE
-rb_threadptr_raise(rb_thread_t *th, int argc, VALUE *argv)
+rb_threadptr_raise(rb_thread_t *target_th, int argc, VALUE *argv)
 {
     VALUE exc;
 
-    if (rb_threadptr_dead(th)) {
+    if (rb_threadptr_dead(target_th)) {
 	return Qnil;
     }
 
@@ -2132,13 +2130,13 @@ rb_threadptr_raise(rb_thread_t *th, int https://github.com/ruby/ruby/blob/trunk/thread.c#L2130
 
     /* making an exception object can switch thread,
        so we need to check thread deadness again */
-    if (rb_threadptr_dead(th)) {
+    if (rb_threadptr_dead(target_th)) {
 	return Qnil;
     }
 
-    rb_threadptr_setup_exception(GET_THREAD(), exc, Qundef);
-    rb_threadptr_pending_interrupt_enque(th, exc);
-    rb_threadptr_interrupt(th);
+    rb_ec_setup_exception(GET_EC(), exc, Qundef);
+    rb_threadptr_pending_interrupt_enque(target_th, exc);
+    rb_threadptr_interrupt(target_th);
     return Qnil;
 }
 
Index: eval.c
===================================================================
--- eval.c	(revision 60691)
+++ eval.c	(revision 60692)
@@ -583,10 +583,10 @@ setup_exception(rb_execution_context_t * https://github.com/ruby/ruby/blob/trunk/eval.c#L583
 
 /*! \private */
 void
-rb_threadptr_setup_exception(rb_thread_t *th, VALUE mesg, VALUE cause)
+rb_ec_setup_exception(const rb_execution_context_t *ec, VALUE mesg, VALUE cause)
 {
     if (cause == Qundef) {
-	cause = get_ec_errinfo(th->ec);
+	cause = get_ec_errinfo(ec);
     }
     if (cause != mesg) {
 	rb_ivar_set(mesg, id_cause, cause);

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]