ged/ruby-pg — pull request #10 by larskanis (2013-05-10 20:59:29+00:00)
Title: Wrap PQnotifies per GVL.

PQnotifies doesn't do/wait for network communication, but PQnotifies can deliver
notifications per callback. The registered callback function is then called with GVL locked.
This results in a rb_bug("rb_thread_call_with_gvl: called by a thread which has GVL.")
if we don't wrap PQnotifies likewise in order to unlock the GVL.

I sometimes noticed this rb_bug() when pressing CTRL-C while the test suite runs.

@ged do you have a smarter idea than wrapping any functions that could call a callback? ruby_thread_has_gvl_p() is only an internal function, so we can not use it. And we can not use any ruby functions unless the GVL is acquired.