Project

General

Profile

Feature #20750 » 11649-lenent-rb_thread_call_with_gvl.patch

Suggested Solution - kbrock (Keenan Brock), 09/19/2024 04:37 PM

View differences:

thread.c
* created as Ruby thread (created by Thread.new or so). In other
* words, this function *DOES NOT* associate or convert a NON-Ruby
* thread to a Ruby thread.
*
* NOTE: If this thread has already aquired the GVL, then the method call
* is performed without acquiring or releasing the GVL.
*/
void *
rb_thread_call_with_gvl(void *(*func)(void *), void *data1)
......
prev_unblock = th->unblock;
if (brb == 0) {
rb_bug("rb_thread_call_with_gvl: called by a thread which has GVL.");
/* the GVL is already acquired, call method directly */
return (*func)(data1);
}
blocking_region_end(th, brb);
(2-2/3)