From: KOSAKI Motohiro Date: 2011-07-10T14:51:37+09:00 Subject: [ruby-dev:44077] Re: [ruby-changes:20438] ko1:r32486 (trunk): * internal.h (rb_thread_call_with_gvl, rb_thread_call_without_gvl): ささださん 以下のコミットのexperimental の意図を教えてください。 rb_thread_io_blocking_region() が internal.h かつ visibility=default という変則的な構成になっているのは ext/socket だけに公開したいけど、ある拡張ライブラリだけに公開する 方法が存在しないため苦肉の策でやっていました。 internal.h はインストールされないので、リポジトリ外の拡張ライブラリからinclude出来ないので。 今回の rb_thread_call_with_gvl() はリポジトリ外からの使用を想定しているので、internal.h は使えなくて、いきなり公開API にするしかないと思うのですが、どうでしょうか 2011/7/10 ko1 : > ko1 2011-07-10 14:19:47 +0900 (Sun, 10 Jul 2011) > > New Revision: 32486 > > http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=32486 > > Log: > * internal.h (rb_thread_call_with_gvl, rb_thread_call_without_gvl): > make them visible as experimental C APIs. fixes Feature #4328. > > Modified files: > trunk/ChangeLog > trunk/internal.h > > Index: ChangeLog > =================================================================== > --- ChangeLog (revision 32485) > +++ ChangeLog (revision 32486) > @@ -1,3 +1,8 @@ > +Sun Jul 10 14:13:50 2011 Koichi Sasada > + > + * internal.h (rb_thread_call_with_gvl, rb_thread_call_without_gvl): > + make them visible as experimental C APIs. fixes Feature #4328. > + > Sun Jul 10 12:18:00 2011 Kenta Murata > > * ext/bigdecimal/bigdecimal.c (BigDecimal_power): support non-integral > Index: internal.h > =================================================================== > --- internal.h (revision 32485) > +++ internal.h (revision 32486) > @@ -164,7 +164,6 @@ > VALUE rb_obj_is_mutex(VALUE obj); > VALUE ruby_suppress_tracing(VALUE (*func)(VALUE, int), VALUE arg, int always); > void rb_thread_execute_interrupts(VALUE th); > -void *rb_thread_call_with_gvl(void *(*func)(void *), void *data1); > void rb_clear_trace_func(void); > VALUE rb_thread_backtrace(VALUE thval); > VALUE rb_get_coverages(void); > @@ -199,8 +198,16 @@ > #if defined __GNUC__ && __GNUC__ >= 4 > #pragma GCC visibility push(default) > #endif > +const char *rb_objspace_data_type_name(VALUE obj); > + > +/* experimental. these APIs can be changed. */ > VALUE rb_thread_io_blocking_region(rb_blocking_function_t *func, void *data1, int fd); > -const char *rb_objspace_data_type_name(VALUE obj); > + > +void *rb_thread_call_with_gvl(void *(*func)(void *), void *data1); > +VALUE rb_thread_call_without_gvl( > + rb_blocking_function_t *func, void *data1, > + rb_unblock_function_t *ubf, void *data2); > + > #if defined __GNUC__ && __GNUC__ >= 4 > #pragma GCC visibility pop > #endif > > -- > ML: ruby-changes@quickml.atdot.net > Info: http://www.atdot.net/~ko1/quickml/ >