diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-09-17 12:07:36 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-09-17 12:07:36 +0000 |
| commit | 643ef3ad50c717e3abf6f226289d8af8a53d068f (patch) | |
| tree | e08880f9327b981289e2024d33930f45dfb83c7f | |
| parent | 49cf40c7814d5f330e9e3a7316d37f84b678a271 (diff) | |
| download | ruby-643ef3ad50c717e3abf6f226289d8af8a53d068f.tar.gz ruby-643ef3ad50c717e3abf6f226289d8af8a53d068f.tar.xz ruby-643ef3ad50c717e3abf6f226289d8af8a53d068f.zip | |
* eval.c (rb_thread_die): put thread dead state.
* eval.c (rb_thread_atfork): free stack buffer at fork too.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 6 | ||||
| -rw-r--r-- | eval.c | 18 |
2 files changed, 18 insertions, 6 deletions
@@ -1,3 +1,9 @@ +Tue Sep 17 21:06:04 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net> + + * eval.c (rb_thread_die): put thread dead state. + + * eval.c (rb_thread_atfork): free stack buffer at fork too. + Tue Sep 17 01:13:31 2002 Yukihiro Matsumoto <matz@ruby-lang.org> * eval.c (rb_mod_nesting): load wrapping module should appear in @@ -7759,18 +7759,25 @@ rb_thread_ready(th) } static void +rb_thread_die(th) + rb_thread_t th; +{ + th->gid = 0; + th->status = THREAD_KILLED; + if (th->stk_ptr) free(th->stk_ptr); + th->stk_ptr = 0; +} + +static void rb_thread_remove(th) rb_thread_t th; { if (th->status == THREAD_KILLED) return; rb_thread_ready(th); - th->status = THREAD_KILLED; - th->gid = 0; + rb_thread_die(th); th->prev->next = th->next; th->next->prev = th->prev; - if (th->stk_ptr) free(th->stk_ptr); - th->stk_ptr = 0; } static int @@ -9186,8 +9193,7 @@ rb_thread_atfork() if (rb_thread_alone()) return; FOREACH_THREAD(th) { if (th != curr_thread) { - th->gid = 0; - th->status = THREAD_KILLED; + rb_thread_die(th); } } END_FOREACH(th); |
