Dear Kou and other readers:
today I compiled ruby-gnome2 from git using ruby from svn, and I
encountered a snag.
It appears that function rb_thread_blocking_region, that was
deprecated, has been eventually removed for good. This function is
only used once in rbglib_maincontext.c.
Substituting it is easy, from what I read: include <ruby/thread.h> and
then call rb_thread_call_without_gvl instead of
rb_thread_blocking_region, with exactly the same parameters.
But there is a problem. Usage of rb_thread_blocking_region is governed
by a macro (HAVE_RB_THREAD_BLOCKING_REGION) that’s defined during
configuration, and if the function is not found, some code which is I
believe older than the insertion of that function is compiled in - see
lines 24-32 of rbglib_maincontext.c. I believe this is old stuff
because there is no way to include version.h like it is done there.
I was able to complete the compilation by:
- adding a
before #ifdef HAVE_RB_THREAD_BLOCKING_REGION in rgbprivate.h,
- adding a
after including rgbprivate.h, in rbglib_maincontext.c, and
rb_thread_blocking_region(rg_poll_in_blocking, &info, RUBY_UBF_IO,
rb_thread_call_without_gvl(rg_poll_in_blocking, &info, RUBY_UBF_IO,
around line 95 in rbglib_maincontext.c.
Of course it’s an ugly hack. I am sure you will concoct the correct
Se la Strada e la sua Virtu' non fossero state messe da
- K * Carlo E. Prelz - [email protected] che bisogno ci
di parlare tanto di amore e di rettitudine?