RubyThread thread = runtime.getCurrentContext().getThread();
NativeFunctionTask task = new NativeFunctionTask(Native.getInstance(runtime), blocking_func,
blocking_data, unblocking_func, unblocking_data);
int lockCount = GIL.releaseAllLocks();
try {
thread.executeBlockingTask(task);
} catch (InterruptedException e) {}
GIL.acquire(lockCount);
return task.retval;
}
}