From: KUBO Takehiro Date: 2009-04-04T18:33:12+09:00 Subject: Re: rb_thread_blocking_region documentation? Hi, On Sat, Apr 4, 2009 at 2:40 PM, Roger Pack wrote: > >> rb_thread_blocking_region >> Help highly appreciated! > > The only thing I've found helpful was to examine the code where > EventMachine used it and try and copy that :) > > mysqlplus uses it. > > http://betterlogic.com/roger/?p=456 > explains it slightly. > I dunno where the "real" docu for it is, though. quote from the blog. > http://github.com/oldmoe/mysqlplus/tree/19_non_gvl_connect/ext/mysql.c > > VALUE answer = rb_thread_blocking_region_variable_params(total_params_right_here - 1, &func_pointer, how_many_params_the_function_takes, param1,param2,param3); As far as I looked in the code, it makes a segmentation fault when the blocking thread is woken up by Thread#wakeup. The third parameter of rb_thread_blocking_region_variable_params in the mysql.c is passed to rb_thread_blocking_region's third parameter. It should be an unblocking function, not an integer.