[macruby-changes] [1643] MacRuby/branches/experimental/thread.c

source_changes at macosforge.org source_changes at macosforge.org
Fri May 29 18:30:46 PDT 2009


Revision: 1643
          http://trac.macosforge.org/projects/ruby/changeset/1643
Author:   lsansonetti at apple.com
Date:     2009-05-29 18:30:46 -0700 (Fri, 29 May 2009)
Log Message:
-----------
added a dummy Mutex#synchronize method that just yields, just to support lib/singleton.rb

Modified Paths:
--------------
    MacRuby/branches/experimental/thread.c

Modified: MacRuby/branches/experimental/thread.c
===================================================================
--- MacRuby/branches/experimental/thread.c	2009-05-30 01:13:05 UTC (rev 1642)
+++ MacRuby/branches/experimental/thread.c	2009-05-30 01:30:46 UTC (rev 1643)
@@ -1168,6 +1168,14 @@
  * completes.  See the example under +Mutex+.
  */
 
+static VALUE
+mutex_synchronize(VALUE self, SEL sel)
+{
+    // TODO
+    rb_yield(Qundef);
+    return Qnil;
+}
+
 VALUE
 rb_thread_synchronize(VALUE mutex, VALUE (*func)(VALUE arg), VALUE arg)
 {
@@ -1243,6 +1251,7 @@
     rb_define_method(rb_cMutex, "lock", rb_mutex_lock, 0);
     rb_define_method(rb_cMutex, "unlock", rb_mutex_unlock, 0);
     rb_define_method(rb_cMutex, "sleep", mutex_sleep, -1);
+    rb_objc_define_method(rb_cMutex, "synchronize", mutex_synchronize, 0);
 
     rb_eThreadError = rb_define_class("ThreadError", rb_eStandardError);
 }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090529/2698bd4b/attachment.html>


More information about the macruby-changes mailing list