diff options
author | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-19 18:02:40 +0000 |
---|---|---|
committer | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-19 18:02:40 +0000 |
commit | 4394ffe521ca03b22761ce4d4afed6645a62ea3d (patch) | |
tree | 75c1c3a3981ad89807a56e7637b93a04d81a1357 | |
parent | e76afc29d8ab491bd69a86504315c4a5dde9616c (diff) | |
download | ruby-4394ffe521ca03b22761ce4d4afed6645a62ea3d.tar.gz |
* thread.c: try to remove false positive of deadlock detection (second
trial).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17451 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | thread.c | 6 |
2 files changed, 9 insertions, 2 deletions
@@ -1,3 +1,8 @@ +Fri Jun 20 03:01:59 2008 Yusuke Endoh <mame@tsg.ne.jp> + + * thread.c: try to remove false positive of deadlock detection (second + trial). + Fri Jun 20 02:16:43 2008 Yukihiro Matsumoto <matz@ruby-lang.org> * lib/mathn.rb (Rational::power2): typo fixed. [ruby-core:17293] @@ -2123,6 +2123,7 @@ rb_thread_atfork(void) st_foreach(vm->living_threads, terminate_atfork_i, (st_data_t)th); st_clear(vm->living_threads); st_insert(vm->living_threads, thval, (st_data_t) th->thread_id); + vm->sleeper = 0; } static int @@ -2149,6 +2150,7 @@ rb_thread_atfork_before_exec(void) st_foreach(vm->living_threads, terminate_atfork_before_exec_i, (st_data_t)th); st_clear(vm->living_threads); st_insert(vm->living_threads, thval, (st_data_t) th->thread_id); + vm->sleeper = 0; } struct thgroup { @@ -2513,6 +2515,7 @@ lock_func(rb_thread_t *th, mutex_t *mutex, int last_thread) th->transition_for_lock = 1; native_mutex_unlock(&mutex->lock); + if (interrupted == 2) native_thread_yield(); #if 0 /* for debug */ native_thread_yield(); #endif @@ -2573,7 +2576,6 @@ rb_mutex_lock(VALUE self) th->locking_mutex = Qfalse; if (mutex->th && interrupted == 2) { rb_check_deadlock(th->vm); - RUBY_VM_SET_TIMER_INTERRUPT(th); } if (th->status == THREAD_STOPPED_FOREVER) { th->status = prev_status; @@ -2671,7 +2673,7 @@ rb_mutex_unlock_all(VALUE mutexes) rb_obj_classname(mutexes), (void*)mutexes); */ mutexes = mutex->next_mutex; err = mutex_unlock(mutex); - if (err) rb_bug("invalid keeping_mutexes"); + if (err) rb_bug("invalid keeping_mutexes: %s", err); } } |