summaryrefslogtreecommitdiff
path: root/vm_core.h
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-07-27 15:20:01 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-07-27 15:20:01 +0000
commitd76ab40bea1532214e8f22c46da7109b9e4c4766 (patch)
tree67dbd42d733a1685af430b7da550267580e56b86 /vm_core.h
parent787cde7f9ab12edafe7559f501a8e21d89e72d72 (diff)
* 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
Diffstat (limited to 'vm_core.h')
-rw-r--r--vm_core.h13
1 files changed, 12 insertions, 1 deletions
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);