Revision
5232
Author
lsansonetti@apple.com
Date
2011-02-15 14:36:06 -0800 (Tue, 15 Feb 2011)

Log Message

add missing CRuby API rb_thread_blocking_region()

Modified Paths

Diff

Modified: MacRuby/trunk/include/ruby/intern.h (5231 => 5232)


--- MacRuby/trunk/include/ruby/intern.h	2011-02-12 03:27:31 UTC (rev 5231)
+++ MacRuby/trunk/include/ruby/intern.h	2011-02-15 22:36:06 UTC (rev 5232)
@@ -559,8 +559,9 @@
 typedef void rb_unblock_function_t(void *);
 typedef VALUE rb_blocking_function_t(void *);
 VALUE rb_thread_blocking_region(rb_blocking_function_t *func, void *data1,
-				rb_unblock_function_t *ubf, void *data2);
-#define RB_UBF_DFL ((rb_unblock_function_t *)-1)
+	rb_unblock_function_t *ubf, void *data2);
+#define RUBY_UBF_IO ((rb_unblock_function_t *)-1)
+#define RUBY_UBF_PROCESS ((rb_unblock_function_t *)-1)
 VALUE rb_barrier_new(void);
 VALUE rb_barrier_wait(VALUE self);
 VALUE rb_barrier_release(VALUE self);

Modified: MacRuby/trunk/thread.c (5231 => 5232)


--- MacRuby/trunk/thread.c	2011-02-12 03:27:31 UTC (rev 5231)
+++ MacRuby/trunk/thread.c	2011-02-15 22:36:06 UTC (rev 5232)
@@ -1664,3 +1664,12 @@
 
     rb_eThreadError = rb_define_class("ThreadError", rb_eStandardError);
 }
+
+VALUE
+rb_thread_blocking_region(rb_blocking_function_t *func, void *data1,
+	rb_unblock_function_t *ubf, void *data2)
+{
+    // For compatibility with CRuby. We do not have a global lock to release,
+    // so we can just call the function directly.
+    return func(data1);
+}