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

ruby-changes:37834

From: ko1 <ko1@a...>
Date: Tue, 10 Mar 2015 17:28:28 +0900 (JST)
Subject: [ruby-changes:37834] ko1:r49915 (trunk): * thread.c (thread_join): Fixnum (except TAG_FATAL) and

ko1	2015-03-10 17:28:22 +0900 (Tue, 10 Mar 2015)

  New Revision: 49915

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

  Log:
    * thread.c (thread_join): Fixnum (except TAG_FATAL) and
      NODE should not be reached here.

  Modified files:
    trunk/ChangeLog
    trunk/thread.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 49914)
+++ ChangeLog	(revision 49915)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Tue Mar 10 17:27:27 2015  Koichi Sasada  <ko1@a...>
+
+	* thread.c (thread_join): Fixnum (except TAG_FATAL) and
+	  NODE should not be reached here.
+
 Mon Mar  9 21:42:10 2015  Koichi Sasada  <ko1@a...>
 
 	* vm_insnhelper.c (ep_cref): rename to lep_cref() because it should be
Index: thread.c
===================================================================
--- thread.c	(revision 49914)
+++ thread.c	(revision 49915)
@@ -884,11 +884,16 @@ thread_join(rb_thread_t *target_th, doub https://github.com/ruby/ruby/blob/trunk/thread.c#L884
 	VALUE err = target_th->errinfo;
 
 	if (FIXNUM_P(err)) {
-	    /* */
+	    switch (err) {
+	      case INT2FIX(TAG_FATAL):
+		/* OK. killed. */
+		break;
+	      default:
+		rb_bug("thread_join: Fixnum (%d) should not reach here.", FIX2INT(err));
+	    }
 	}
 	else if (RB_TYPE_P(target_th->errinfo, T_NODE)) {
-	    rb_exc_raise(rb_vm_make_jump_tag_but_local_jump(
-		GET_THROWOBJ_STATE(err), GET_THROWOBJ_VAL(err)));
+	    rb_bug("thread_join: NODE should not reach here.");
 	}
 	else {
 	    /* normal exception */

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

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