mattn/mruby-uv — pull request #32 by take-cheeze (2014-04-19 12:58:35+00:00)
Title: Force cfunc in queue_work's work_cb and add test for it.

This changes is to make API `UV.queue_work` more safer.
Since `uv_work_cb` would be always runned on separate thread as mruby runs, running block on it will break running context of mruby.
On new mruby-uv `uv_work_cb`, it can only run cfunc proc that can run separately with `mrb_state` that is passed to `UV.queue_work` as argument.
(The cfunc would be called with arguments `NULL, mrb_nil_value()` and returned value would be discarded.)
And the block passed to `UV.queue_work` would be runned on `uv_after_work_cb`.
(See the test codes for detail. It will run summing of 0 to 99 on other thread.)