[#11890] Ruby and Solaris door library — "Hiro Asari" <asari.ruby@...>

Hi, there. This is my first patch against ruby. I think I followed

19 messages 2007/08/13
[#11892] Re: Ruby and Solaris door library — Daniel Berger <djberg96@...> 2007/08/14

Hiro Asari wrote:

[#11899] pack/unpack 64bit Integers — Hadmut Danisch <hadmut@...>

Hi,

13 messages 2007/08/14
[#11903] Re: pack/unpack 64bit Integers — Brian Candler <B.Candler@...> 2007/08/15

On Wed, Aug 15, 2007 at 06:50:01AM +0900, Hadmut Danisch wrote:

[#11948] Fibers in Ruby 1.9? — David Flanagan <david@...>

I just noticed that my ruby1.9 build of August 17th includes a Fiber

22 messages 2007/08/22
[#11949] Re: Fibers in Ruby 1.9? — Daniel Berger <djberg96@...> 2007/08/22

David Flanagan wrote:

[#11950] Re: Fibers in Ruby 1.9? — "Francis Cianfrocca" <garbagecat10@...> 2007/08/22

On 8/22/07, Daniel Berger <djberg96@gmail.com> wrote:

[#11952] Re: Fibers in Ruby 1.9? — MenTaLguY <mental@...> 2007/08/22

On Wed, 22 Aug 2007 20:50:12 +0900, "Francis Cianfrocca" <garbagecat10@gmail.com> wrote:

[#11988] String#length not working properly in Ruby 1.9 — "Vincent Isambart" <vincent.isambart@...>

I saw that Matz just merged his M17N implementation in the trunk.

17 messages 2007/08/25
[#11991] Re: String#length not working properly in Ruby 1.9 — "Michael Neumann" <mneumann@...> 2007/08/25

On Sat, 25 Aug 2007 10:54:20 +0200, Yukihiro Matsumoto

[#11992] Re: String#length not working properly in Ruby 1.9 — Yukihiro Matsumoto <matz@...> 2007/08/25

Hi,

[#12042] Encodings of string literals; explicit codepoint escapes? — David Flanagan <david@...>

This message contains queries that probably only Matz can answer:

16 messages 2007/08/31
[#12043] Re: Encodings of string literals; explicit codepoint escapes? — Yukihiro Matsumoto <matz@...> 2007/08/31

Hi,

Re: Thread.abort_on_exception= in Ruby 1.9

From: Nobuyoshi Nakada <nobu@...>
Date: 2007-08-09 03:28:34 UTC
List: ruby-core #11879
Hi,

At Thu, 9 Aug 2007 09:06:30 +0900,
Yukihiro Matsumoto wrote in [ruby-core:11877]:
> |Thread.abort_on_exception=true is not working the way I would expect it 
> |to in Ruby 1.9 (my build is from 7/24).
> 
> The 1.9 does not handle abort_on_exception yet.  It should be before
> the final release.  I file this and [ruby-core:11873] (Thread#join
> giving wrong backtrace) as bugs.

You meant [ruby-core:11874]?  Those stackframes seem to be
optimized out.


Index: thread.c
===================================================================
--- thread.c	(revision 12908)
+++ thread.c	(working copy)
@@ -278,4 +278,7 @@ thread_cleanup_func(void *th_ptr)
 }
 
+extern void ruby_error_print(void);
+static VALUE rb_thread_raise(int, VALUE *, rb_thread_t *);
+
 static int
 thread_start_func_2(rb_thread_t *th, VALUE *stack_start, VALUE *register_stack_start)
@@ -285,4 +288,7 @@ thread_start_func_2(rb_thread_t *th, VAL
     rb_proc_t *proc;
     rb_thread_t *join_th;
+    rb_thread_t *main_th;
+    VALUE errinfo = Qnil;
+
     th->machine_stack_start = stack_start;
 #ifdef __ia64
@@ -314,4 +320,10 @@ thread_start_func_2(rb_thread_t *th, VAL
 	}
 	else {
+	    if (th->safe_level < 4 &&
+		(th->vm->thread_abort_on_exception ||
+		 th->abort_on_exception || RTEST(ruby_debug))) {
+		errinfo = th->errinfo;
+		if (NIL_P(errinfo)) errinfo = rb_errinfo();
+	    }
 	    th->value = Qnil;
 	}
@@ -322,7 +334,11 @@ thread_start_func_2(rb_thread_t *th, VAL
 	st_delete_wrap(th->vm->living_threads, th->self);
 
+	main_th = th->vm->main_thread;
+	if (th == main_th) errinfo = Qnil;
+
 	/* wake up joinning threads */
 	join_th = th->join_list_head;
 	while (join_th) {
+	    if (join_th == main_th) errinfo = Qnil;
 	    rb_thread_interrupt(join_th);
 	    join_th = join_th->join_list_next;
@@ -332,4 +348,10 @@ thread_start_func_2(rb_thread_t *th, VAL
     thread_cleanup_func(th);
     native_mutex_unlock(&th->vm->global_interpreter_lock);
+
+    if (!NIL_P(errinfo)) {
+	/* exit on main_thread */
+	rb_thread_raise(1, &errinfo, main_th);
+    }
+
     return 0;
 }


-- 
Nobu Nakada

In This Thread