From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS47066 71.19.144.0/20 X-Spam-Status: No, score=-1.2 required=3.0 tests=AWL,BAYES_00,FREEMAIL_FROM, FROM_STARTS_WITH_NUMS,MSGID_FROM_MTA_HEADER shortcircuit=no autolearn=no version=3.3.2 Path: news.gmane.org!not-for-mail From: Hleb Valoshka <375gnu@gmail.com> Newsgroups: gmane.comp.lang.ruby.kgio.general Subject: Re: [PATCH] Don't use deprecated api Date: Sun, 19 Jan 2014 22:42:55 +0300 Message-ID: References: <1388087827-13015-1-git-send-email-375GNU@Gmail.COM> <20140116235651.GC30399@dcvr.yhbt.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1390160578 7159 80.91.229.3 (19 Jan 2014 19:42:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 19 Jan 2014 19:42:58 +0000 (UTC) To: kgio@librelist.org Original-X-From: kgio@librelist.org Sun Jan 19 20:43:05 2014 Return-path: Envelope-to: gclrkg-kgio@m.gmane.org List-Archive: List-Help: List-Id: List-Post: List-Subscribe: List-Unsubscribe: Precedence: list Original-Sender: kgio@librelist.org Xref: news.gmane.org gmane.comp.lang.ruby.kgio.general:251 Archived-At: Received: from zedshaw2.xen.prgmr.com ([71.19.156.177]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1W4yGv-0000Qy-5P for gclrkg-kgio@m.gmane.org; Sun, 19 Jan 2014 20:43:05 +0100 Received: from zedshaw2.xen.prgmr.com (unknown [IPv6:::1]) by zedshaw2.xen.prgmr.com (Postfix) with ESMTP id 0BC8974B0D for ; Sun, 19 Jan 2014 19:50:01 +0000 (UTC) The patch is almost done (it was tested with mri1.8, 1.9.3 and 2.0), but before I finish it, I should ask about correctness of the following patch. Is this replacement is correct? commit a6e30828439d5fb194ffe74b26a0ad06b96057c9 Author: Hleb Valoshka <375gnu@gmail.com> Date: Sun Jan 19 22:35:11 2014 +0300 use rb_thread_io_blocking_region dunno whether this is correct replacement diff --git a/ext/kgio/poll.c b/ext/kgio/poll.c index 15774d8..5573247 100644 --- a/ext/kgio/poll.c +++ b/ext/kgio/poll.c @@ -5,6 +5,7 @@ #include "broken_system_compat.h" #include #include +#include "blocking_io_region.h" #ifdef HAVE_RUBY_ST_H # include #else @@ -145,7 +146,7 @@ static VALUE do_poll(VALUE args) retry: hash2pollfds(a); - nr = (int)rb_thread_blocking_region(nogvl_poll, a, RUBY_UBF_IO, NULL); + nr = (int)rb_thread_io_blocking_region(nogvl_poll, a, 0); if (nr < 0) { if (interrupted()) { if (retryable(a)) {