[#1] Welcome to the ruby-core mailing list — matz@... (Yukihiro Matsumoto)
Hi,
[#7] Useless patch... — Michal Rokos <m.rokos@...>
Hi,
[#19] Re: [BUG] thread failure after trap — nobu.nokada@...
Hi,
>>>>> "n" == nobu nokada <nobu.nokada@softhome.net> writes:
Hi,
[#42] Re: possible bug: stack dump with <<-String, #{...} and large loops — ts <decoux@...>
Hi,
>>>>> "n" == nobu nokada <nobu.nokada@softhome.net> writes:
Hi,
>>>>> "n" == nobu nokada <nobu.nokada@softhome.net> writes:
>>>>> "t" == ts <decoux@moulon.inra.fr> writes:
Hi,
>>>>> "n" == nobu nokada <nobu.nokada@softhome.net> writes:
Hi,
>>>>> "n" == nobu nokada <nobu.nokada@softhome.net> writes:
Hi,
>>>>> "n" == nobu nokada <nobu.nokada@softhome.net> writes:
Hi,
>>>>> "n" == nobu nokada <nobu.nokada@softhome.net> writes:
Hi,
>>>>> "n" == nobu nokada <nobu.nokada@softhome.net> writes:
Hi,
>>>>> "n" == nobu nokada <nobu.nokada@softhome.net> writes:
Hi,
>>>>> "n" == nobu nokada <nobu.nokada@softhome.net> writes:
Hi,
>>>>> "n" == nobu nokada <nobu.nokada@softhome.net> writes:
[#59] yyparse() and friends >> rubyparse() or rbparse()... — Sean Chittenden <sean@...>
Would it be possible to add '-p ruby' to the bison command line args
Hi,
> |Would it be possible to add '-p ruby' to the bison command line
[#67] The warns-a-thon continues... — Sean Chittenden <sean@...>
I'm feeling left out in this race to clobber warnings!!! Attached are
Hi,
Hi,
> :*) Fixed some sprintf() format type mismatches
[#86] rb_hash_has_key() and friends non-static... — Sean Chittenden <sean@...>
I'm doing a lot of work with Ruby in C and am using some of Ruby's
At the moment I'm writing an appendix Beginning Ruby Programming
Hi,
[#104] Re: possible bug: stack dump with <<-String, #{...} and large loops — ts <decoux@...>
>>>>> "n" == nobu nokada <nobu.nokada@softhome.net> writes:
Hi,
>>>>> "n" == nobu nokada <nobu.nokada@softhome.net> writes:
Hi,
>>>>> "n" == nobu nokada <nobu.nokada@softhome.net> writes:
Hi,
>>>>> "n" == nobu nokada <nobu.nokada@softhome.net> writes:
Hi,
Hi,
>>>>> "n" == nobu nokada <nobu.nokada@softhome.net> writes:
>>>>> "t" == ts <decoux@moulon.inra.fr> writes:
Hi,
Re: [BUG] thread failure after trap
>>>>> "n" == nobu nokada <nobu.nokada@softhome.net> writes:
n> Sure. But I wonder if other values should be preserved.
If I've well understood, a signal is always run in the main thread.
After the signal, ruby must give the control to the current thread (the
thread which has received the signal) because this thread need to test if
some others signals are pending and it must restore the old value for the
main thread.
pigeon% diff -u eval.c.old eval.c
--- eval.c.old Thu May 16 06:58:11 2002
+++ eval.c Thu May 16 06:59:08 2002
@@ -7422,6 +7422,8 @@
static int th_sig;
static char *th_signm;
+static rb_thread_t th_thread;
+
#define RESTORE_NORMAL 1
#define RESTORE_FATAL 2
#define RESTORE_INTERRUPT 3
@@ -7477,6 +7479,8 @@
th->line = ruby_sourceline;
}
+static void rb_thread_restore_context _((rb_thread_t,int));
+
static int
thread_switch(n)
int n;
@@ -7493,6 +7497,10 @@
case RESTORE_TRAP:
rb_trap_eval(th_cmd, th_sig);
errno = EINTR;
+ if (th_thread) {
+ curr_thread = th_thread;
+ rb_thread_restore_context(curr_thread, RESTORE_NORMAL);
+ }
break;
case RESTORE_RAISE:
ruby_frame->last_func = 0;
@@ -7513,8 +7521,6 @@
#define THREAD_SAVE_CONTEXT(th) \
(rb_thread_save_context(th),thread_switch(setjmp((th)->context)))
-static void rb_thread_restore_context _((rb_thread_t,int));
-
static void
stack_extend(th, exit)
rb_thread_t th;
@@ -8839,6 +8845,8 @@
VALUE cmd;
int sig;
{
+ volatile int status;
+ volatile int wait_for;
#if 0
rb_thread_critical = 0;
if (!rb_thread_dead(curr_thread)) {
@@ -8856,8 +8864,14 @@
rb_thread_restore_context(curr_thread, RESTORE_TRAP);
#else
rb_thread_critical = 0;
+ th_thread = 0;
if (!rb_thread_dead(curr_thread)) {
+ th_thread = curr_thread;
+ status = main_thread->status;
+ wait_for = main_thread->wait_for;
if (THREAD_SAVE_CONTEXT(curr_thread)) {
+ main_thread->status = status;
+ main_thread->wait_for = wait_for;
return;
}
}
pigeon%
Guy Decoux