diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-07-03 12:23:28 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-07-03 12:23:28 +0000 |
commit | 4ca870d0c4c45b58fdf9957b673db0f7190e1afa (patch) | |
tree | 631d4c1e238f752aeb4cd413094332adf32a78a2 | |
parent | 005a7bb5d1bf1bb35706ffd558c93ceb558f7a44 (diff) |
merges r30272 from trunk into ruby_1_9_2.
--
* thread.c (thread_cleanup_func): Don't touch native threading
resource at fork. Sadly this is purely bandaid. We need to
implement proper fix later. [Bug #4169] [ruby-core:33767]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@32375 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | thread.c | 15 | ||||
-rw-r--r-- | version.h | 8 |
3 files changed, 22 insertions, 7 deletions
@@ -1,3 +1,9 @@ +Tue Dec 21 00:46:20 2010 KOSAKI Motohiro <kosaki.motohiro@gmail.com> + + * thread.c (thread_cleanup_func): Don't touch native threading + resource at fork. Sadly this is purely bandaid. We need to + implement proper fix later. [Bug #4169] [ruby-core:33767] + Tue May 24 07:06:34 2011 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp> * ext/tk/lib/tk/extconf.rb: search directories for 64bit library (e.g. @@ -389,12 +389,21 @@ thread_cleanup_func_before_exec(void *th_ptr) } static void -thread_cleanup_func(void *th_ptr) +thread_cleanup_func(void *th_ptr, int atfork) { rb_thread_t *th = th_ptr; th->locking_mutex = Qfalse; thread_cleanup_func_before_exec(th_ptr); + + /* + * Unfortunately, we can't release native threading resource at fork + * because libc may have unstable locking state therefore touching + * a threading resource may cause a deadlock. + */ + if (atfork) + return; + native_thread_destroy(th); } @@ -524,7 +533,7 @@ thread_start_func_2(rb_thread_t *th, VALUE *stack_start, VALUE *register_stack_s ruby_cleanup(state); } else { - thread_cleanup_func(th); + thread_cleanup_func(th, FALSE); native_mutex_unlock(&th->vm->global_vm_lock); } @@ -2776,7 +2785,7 @@ terminate_atfork_i(st_data_t key, st_data_t val, st_data_t current_th) rb_mutex_abandon_all(th->keeping_mutexes); } th->keeping_mutexes = NULL; - thread_cleanup_func(th); + thread_cleanup_func(th, TRUE); } return ST_CONTINUE; } @@ -1,13 +1,13 @@ #define RUBY_VERSION "1.9.2" -#define RUBY_PATCHLEVEL 274 +#define RUBY_PATCHLEVEL 275 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 9 #define RUBY_VERSION_TEENY 1 #define RUBY_RELEASE_YEAR 2011 -#define RUBY_RELEASE_MONTH 6 -#define RUBY_RELEASE_DAY 6 -#define RUBY_RELEASE_DATE "2011-06-06" +#define RUBY_RELEASE_MONTH 7 +#define RUBY_RELEASE_DAY 3 +#define RUBY_RELEASE_DATE "2011-07-03" #include "ruby/version.h" |