From d76ab40bea1532214e8f22c46da7109b9e4c4766 Mon Sep 17 00:00:00 2001 From: mame Date: Sun, 27 Jul 2008 15:20:01 +0000 Subject: * vm_core.h, thread.c: It is now prohibited to use Data_Get_Struct in *_free against an object that is going to be free'ed. So, change type of thread_t#keeping_mutexes from VALUE to mutex_t. * vm.c: remove mark to keeping_mutexes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm_core.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'vm_core.h') diff --git a/vm_core.h b/vm_core.h index 7ac6bb1ceb..5a97d10edd 100644 --- a/vm_core.h +++ b/vm_core.h @@ -396,6 +396,8 @@ struct rb_unblock_callback { void *arg; }; +struct rb_mutex_struct; + struct rb_thread_struct { VALUE self; @@ -443,7 +445,7 @@ struct rb_thread_struct rb_thread_lock_t interrupt_lock; struct rb_unblock_callback unblock; VALUE locking_mutex; - VALUE keeping_mutexes; + struct rb_mutex_struct *keeping_mutexes; int transition_for_lock; struct rb_vm_tag *tag; @@ -496,6 +498,15 @@ struct rb_thread_struct int abort_on_exception; }; +struct rb_mutex_struct +{ + rb_thread_lock_t lock; + rb_thread_cond_t cond; + struct rb_thread_struct volatile *th; + volatile int cond_waiting, cond_notified; + struct rb_mutex_struct *next_mutex; +}; + /* iseq.c */ VALUE rb_iseq_new(NODE*, VALUE, VALUE, VALUE, VALUE); VALUE rb_iseq_new_with_bopt(NODE*, VALUE, VALUE, VALUE, VALUE, VALUE); -- cgit v1.2.3