diff options
author | Eric Wong <e@80x24.org> | 2014-02-08 20:40:40 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2014-02-08 20:40:40 +0000 |
commit | c9e8f1ee4abed6906fd2bead991eeb2c623185da (patch) | |
tree | 94405ca4595cb1b9ad3c6f7cbc74451918b99603 /ext/kgio/accept.c | |
parent | 00f0737e158924d88cc5000e9a7bb891e5ba3a1b (diff) | |
download | kgio-c9e8f1ee4abed6906fd2bead991eeb2c623185da.tar.gz |
It'll be OK to use rb_thread_call_without_gvl when rb_thread_blocking_region is not detectable at all. We still use rb_thread_blocking_region for Ruby 2.0-2.1 because rb_thread_call_without_gvl was detectable in 1.9.3, but not usable as an internal symbol. ref: https://bugs.ruby-lang.org/issues/9502
Diffstat (limited to 'ext/kgio/accept.c')
-rw-r--r-- | ext/kgio/accept.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/kgio/accept.c b/ext/kgio/accept.c index eb40f32..c847c92 100644 --- a/ext/kgio/accept.c +++ b/ext/kgio/accept.c @@ -13,7 +13,7 @@ static VALUE cKgio_Socket; static VALUE mSocketMethods; static VALUE iv_kgio_addr; -#if defined(__linux__) && defined(KGIO_HAVE_THREAD_CALL_WITHOUT_GVL) +#if defined(__linux__) && defined(KGIO_WITHOUT_GVL) static int accept4_flags = SOCK_CLOEXEC; #else /* ! linux */ static int accept4_flags = SOCK_CLOEXEC | SOCK_NONBLOCK; @@ -79,7 +79,7 @@ static VALUE xaccept(void *ptr) return (VALUE)rv; } -#ifdef KGIO_HAVE_THREAD_CALL_WITHOUT_GVL +#ifdef KGIO_WITHOUT_GVL # include <time.h> # include "blocking_io_region.h" static int thread_accept(struct accept_args *a, int force_nonblock) @@ -89,7 +89,7 @@ static int thread_accept(struct accept_args *a, int force_nonblock) return (int)rb_thread_io_blocking_region(xaccept, a, a->fd); } -#else /* ! KGIO_HAVE_THREAD_CALL_WITHOUT_GVL */ +#else /* ! KGIO_WITHOUT_GVL */ # include <rubysig.h> static int thread_accept(struct accept_args *a, int force_nonblock) { @@ -106,7 +106,7 @@ static int thread_accept(struct accept_args *a, int force_nonblock) TRAP_END; return rv; } -#endif /* ! KGIO_HAVE_THREAD_CALL_WITHOUT_GVL */ +#endif /* ! KGIO_WITHOUT_GVL */ static void prepare_accept(struct accept_args *a, VALUE self, int argc, const VALUE *argv) |