ext/kgio/kgio.h in kgio-2.9.1 vs ext/kgio/kgio.h in kgio-2.9.2
- old
+ new
@@ -37,19 +37,19 @@
void kgio_autopush_recv(VALUE);
void kgio_autopush_send(VALUE);
VALUE kgio_call_wait_writable(VALUE io);
VALUE kgio_call_wait_readable(VALUE io);
-#if defined(HAVE_RB_THREAD_CALL_WITHOUT_GVL)
-# define KGIO_HAVE_THREAD_CALL_WITHOUT_GVL 1
-typedef void *(*kgio_blocking_fn_t)(void*);
-# define rb_thread_blocking_region(fn,data1,ubf,data2) \
- rb_thread_call_without_gvl((kgio_blocking_fn_t)(fn),(data1),(ubf),(data2))
+#if defined(HAVE_RB_THREAD_CALL_WITHOUT_GVL) && defined(HAVE_RUBY_THREAD_H)
+# define KGIO_WITHOUT_GVL(fn,data1,ubf,data2) \
+ rb_thread_call_without_gvl((fn),(data1),(ubf),(data2))
#elif defined(HAVE_RB_THREAD_BLOCKING_REGION)
-# define KGIO_HAVE_THREAD_CALL_WITHOUT_GVL 1
+typedef VALUE(*kgio_blocking_fn_t)(void*);
+# define KGIO_WITHOUT_GVL(fn,data1,ubf,data2) \
+ rb_thread_blocking_region((kgio_blocking_fn_t)(fn),(data1),(ubf),(data2))
#endif /* HAVE_RB_THREAD_CALL_WITHOUT_GVL || HAVE_RB_THREAD_BLOCKING_REGION */
-#if defined(KGIO_HAVE_THREAD_CALL_WITHOUT_GVL) && defined(HAVE_POLL)
+#if defined(KGIO_WITHOUT_GVL) && defined(HAVE_POLL)
# define USE_KGIO_POLL
#endif /* USE_KGIO_POLL */
#ifndef HAVE_RB_UPDATE_MAX_FD
# define rb_update_max_fd(fd) for (;0;)