From: "larskanis1 (Lars Kanis)" Date: 2012-07-08T05:06:58+09:00 Subject: [ruby-core:46239] [ruby-trunk - Feature #5543] rb_thread_blocking_region() API is poorly designed Issue #5543 has been updated by larskanis1 (Lars Kanis). OK, then use 'void *' like rb_thread_call_with_gvl(). ---------------------------------------- Feature #5543: rb_thread_blocking_region() API is poorly designed https://bugs.ruby-lang.org/issues/5543#change-27866 Author: cjameshuff (Christopher Huff) Status: Feedback Priority: Normal Assignee: ko1 (Koichi Sasada) Category: Target version: 2.0.0 First, rb_thread_blocking_region() requires the blocking code to be pulled out into a separate function, scattering code through the source file and giving the coder more work to do to pass information through to that function. Something like rb_thread_blocking_region_begin() and rb_thread_blocking_region_end(), or the BLOCKING_REGION macro used to implement rb_thread_blocking_region(), would be far more convenient to use, but were apparently deprecated and are now only usable within thread.c. Worse, the function passed to rb_thread_blocking_region() must return a Ruby VALUE, but also must execute without a VM lock. It is rather nonsensical to specify that a function return a Ruby object while forbidding it from accessing most of Ruby. It is likely the function won't touch the anything related to Ruby at all, and while you can use casting to work around it, you shouldn't have to. The main result of all this is less readable and even somewhat misleading code. -- http://bugs.ruby-lang.org/