diff options
author | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-12 13:01:38 +0000 |
---|---|---|
committer | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-12 13:01:38 +0000 |
commit | 6f5aaff73b2b4e17666308dde93e1ac4edb3927d (patch) | |
tree | d2045cf78eb8d6b894357491b6686fa8d23b740f /vm.c | |
parent | 2b66844f487574e2bcce1e3697883452d1f5d7fc (diff) | |
download | ruby-6f5aaff73b2b4e17666308dde93e1ac4edb3927d.tar.gz |
* thread.c, vm_core.h, vm.c, thread_pthread.c, thread_win32.c: add
deadlock detection. [ruby-dev:35044]
* bootstraptest/test_thread.rb: add tests for above.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17110 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm.c')
-rw-r--r-- | vm.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -1470,6 +1470,13 @@ thread_free(void *ptr) RUBY_FREE_UNLESS_NULL(th->stack); } + if (th->locking_mutex != Qfalse) { + rb_bug("thread_free: locking_mutex must be NULL (%p:%ld)", th, th->locking_mutex); + } + if (th->keeping_mutexes != Qfalse) { + rb_bug("thread_free: keeping_mutexes must be NULL (%p:%ld)", th, th->locking_mutex); + } + if (th->local_storage) { st_free_table(th->local_storage); } @@ -1537,6 +1544,8 @@ rb_thread_mark(void *ptr) RUBY_MARK_UNLESS_NULL(th->root_fiber); RUBY_MARK_UNLESS_NULL(th->stat_insn_usage); + RUBY_MARK_UNLESS_NULL(th->locking_mutex); + rb_mark_tbl(th->local_storage); if (GET_THREAD() != th && th->machine_stack_start && th->machine_stack_end) { |