diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-07-10 13:57:11 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-07-10 13:57:11 +0000 |
commit | c51a826764c3307a7fe9258e1d18ddca93cb7b5f (patch) | |
tree | b6139e61fe139e418a606ff611b0b6c30ce30dfe /ext/zlib | |
parent | 1a853390ee08af1b8ff3d1882a8762155d151306 (diff) |
rb_thread_call_without_gvl
* include/ruby/thread.h: new header file for thread stuff.
* thread.c (rb_thread_call_without_gvl): export. [Feature#4328]
returns void* instead of VALUE. [Feature #5543]
* thread.c (rb_thread_blocking_region): deprecate. [ruby-core:46295]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36355 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/zlib')
-rw-r--r-- | ext/zlib/zlib.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index fc49e4454a..3fb1be91ae 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -10,6 +10,7 @@ #include <zlib.h> #include <time.h> #include <ruby/io.h> +#include <ruby/thread.h> #ifdef HAVE_VALGRIND_MEMCHECK_H # include <valgrind/memcheck.h> @@ -916,7 +917,7 @@ zstream_end(struct zstream *z) return Qnil; } -static VALUE +static void * zstream_run_func(void *ptr) { struct zstream_run_args *args = (struct zstream_run_args *)ptr; @@ -950,7 +951,7 @@ zstream_run_func(void *ptr) } } - return (VALUE)err; + return (void *)err; } /* @@ -994,7 +995,7 @@ zstream_run(struct zstream *z, Bytef *src, long len, int flush) } loop: - err = (int)rb_thread_blocking_region( + err = (int)rb_thread_call_without_gvl( zstream_run_func, (void *)&args, zstream_unblock_func, (void *)&args); |