[macruby-changes] [5232] MacRuby/trunk
source_changes at macosforge.org
source_changes at macosforge.org
Tue Feb 15 14:36:06 PST 2011
Revision: 5232
http://trac.macosforge.org/projects/ruby/changeset/5232
Author: lsansonetti at 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:
--------------
MacRuby/trunk/include/ruby/intern.h
MacRuby/trunk/thread.c
Modified: MacRuby/trunk/include/ruby/intern.h
===================================================================
--- 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
===================================================================
--- 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);
+}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20110215/76db2f40/attachment.html>
More information about the macruby-changes
mailing list