[macruby-changes] [5143] MacRuby/trunk/thread.c

source_changes at macosforge.org source_changes at macosforge.org
Sat Jan 8 10:53:19 PST 2011


Revision: 5143
          http://trac.macosforge.org/projects/ruby/changeset/5143
Author:   lsansonetti at apple.com
Date:     2011-01-08 10:53:14 -0800 (Sat, 08 Jan 2011)
Log Message:
-----------
fix a bug in {Thread,ThreadGroup,Mutex}#alloc where we would not return objects from the current class (could be a subclass)

Modified Paths:
--------------
    MacRuby/trunk/thread.c

Modified: MacRuby/trunk/thread.c
===================================================================
--- MacRuby/trunk/thread.c	2011-01-08 17:18:48 UTC (rev 5142)
+++ MacRuby/trunk/thread.c	2011-01-08 18:53:14 UTC (rev 5143)
@@ -41,11 +41,11 @@
 #endif
 
 static VALUE
-thread_s_alloc(VALUE rcv, SEL sel)
+thread_s_alloc(VALUE self, SEL sel)
 {
     rb_vm_thread_t *t = (rb_vm_thread_t *)xmalloc(sizeof(rb_vm_thread_t));
     t->thread = 0;
-    return Data_Wrap_Struct(rb_cThread, NULL, NULL, t);
+    return Data_Wrap_Struct(self, NULL, NULL, t);
 }
 
 static IMP
@@ -1183,7 +1183,7 @@
     mutex_initialize(mutex, 0);
     GC_WB(&t->mutex, mutex);
 
-    return Data_Wrap_Struct(rb_cThGroup, NULL, NULL, t);
+    return Data_Wrap_Struct(self, NULL, NULL, t);
 }
 
 /*
@@ -1375,7 +1375,7 @@
 mutex_s_alloc(VALUE self, SEL sel)
 {
     rb_vm_mutex_t *t = (rb_vm_mutex_t *)xmalloc(sizeof(rb_vm_mutex_t));
-    return Data_Wrap_Struct(rb_cMutex, NULL, NULL, t);
+    return Data_Wrap_Struct(self, NULL, NULL, t);
 }
 
 static VALUE
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20110108/9b93edfd/attachment.html>


More information about the macruby-changes mailing list