kgio RubyGem user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
From: Hleb Valoshka <375gnu@gmail.com>
To: kgio@librelist.org
Subject: Re: [PATCH] Don't use deprecated api
Date: Sun, 19 Jan 2014 22:42:55 +0300	[thread overview]
Message-ID: <CAAB-KcnGxkh63FeWz1j3zxeA1GoiEptygHxqBmsDEy5tcENyNw@mail.gmail.com> (raw)
In-Reply-To: CAAB-Kc=qX6Gg6+pN5Bjqn==0uSwQtVCuEb4hn5RszpNN1M90sg@mail.gmail.com

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 <poll.h>
 #include <errno.h>
+#include "blocking_io_region.h"
 #ifdef HAVE_RUBY_ST_H
 #  include <ruby/st.h>
 #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)) {


  reply	other threads:[~2014-01-19 19:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-26 19:57 [PATCH] Don't use deprecated api Hleb Valoshka
2013-12-27  0:19 ` Eric Wong
2014-01-16 23:56 ` Eric Wong
2014-01-17  8:37   ` Hleb Valoshka
2014-01-19 19:42     ` Hleb Valoshka [this message]
2014-01-19 23:13       ` Eric Wong
2014-01-20 19:35         ` Hleb Valoshka
2014-01-20 19:36           ` Hleb Valoshka
2014-01-20 21:12             ` Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://yhbt.net/kgio/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAAB-KcnGxkh63FeWz1j3zxeA1GoiEptygHxqBmsDEy5tcENyNw@mail.gmail.com \
    --to=375gnu@gmail.com \
    --cc=kgio@librelist.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhbt.net/kgio.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).