diff options
| author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-05-16 09:05:54 +0000 |
|---|---|---|
| committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-05-16 09:05:54 +0000 |
| commit | db52e5b5ecd6a47d2be539030686ca92d2b2c417 (patch) | |
| tree | fba985cc67803c80f7761462f79cf988cbf6507b /eval.c | |
| parent | 200f5e76a2410b848f1ab8c145e96aded6ef4455 (diff) | |
| download | ruby-db52e5b5ecd6a47d2be539030686ca92d2b2c417.tar.gz ruby-db52e5b5ecd6a47d2be539030686ca92d2b2c417.tar.xz ruby-db52e5b5ecd6a47d2be539030686ca92d2b2c417.zip | |
* array.c (rb_ary_and): should not push frozen key string.
* array.c (rb_ary_or): ditto.
* eval.c (rb_thread_schedule): should save context before raising
deadlock, saved context for current thread might be obsolete.
* time.c (make_time_t): non DST timezone shift supported (hopefully).
* time.c (make_time_t): strict range detection for negative time_t.
* signal.c: SIGINFO added.
* eval.c (rb_ensure): should not SEGV when prot_tag is NULL.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@1399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
| -rw-r--r-- | eval.c | 17 |
1 files changed, 15 insertions, 2 deletions
@@ -4004,9 +4004,9 @@ rb_ensure(b_proc, data1, e_proc, data2) result = (*b_proc)(data1); } POP_TAG(); - retval = prot_tag->retval; /* save retval */ + retval = prot_tag ? prot_tag->retval : Qnil; /* save retval */ (*e_proc)(data2); - return_value(retval); + if (prot_tag) return_value(retval); if (state) JUMP_TAG(state); return result; @@ -7551,6 +7551,7 @@ rb_thread_schedule() next->gid = 0; rb_thread_ready(next); next->status = THREAD_TO_KILL; + rb_thread_save_context(curr_thread); rb_thread_deadlock(); } next->wait_for = 0; @@ -8338,8 +8339,20 @@ rb_thread_stop_p(thread) static void rb_thread_wait_other_threads() { + rb_thread_t th; + int found; + /* wait other threads to terminate */ while (curr_thread != curr_thread->next) { + found = 0; + FOREACH_THREAD(th) { + if (th != curr_thread && th->status != THREAD_STOPPED) { + found = 1; + break; + } + } + END_FOREACH(th); + if (!found) return; rb_thread_schedule(); } } |
