[前][次][番号順一覧][スレッド一覧]

ruby-changes:26350

From: kosaki <ko1@a...>
Date: Sat, 15 Dec 2012 14:40:38 +0900 (JST)
Subject: [ruby-changes:26350] kosaki:r38401 (trunk): * io.c (finish_writeconv): uses rb_write_internal2 if

kosaki	2012-12-15 14:40:29 +0900 (Sat, 15 Dec 2012)

  New Revision: 38401

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=38401

  Log:
    * io.c (finish_writeconv): uses rb_write_internal2 if
      fptr->write_lock have.

  Modified files:
    trunk/ChangeLog
    trunk/io.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 38400)
+++ ChangeLog	(revision 38401)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat Dec 15 14:18:44 2012  KOSAKI Motohiro  <kosaki.motohiro@g...>
+
+	* io.c (finish_writeconv): uses rb_write_internal2 if
+	  fptr->write_lock have.
+
 Sat Dec 15 13:57:08 2012  KOSAKI Motohiro  <kosaki.motohiro@g...>
 
 	* thread.c (rb_mutex_owned_p): remove static.
Index: io.c
===================================================================
--- io.c	(revision 38400)
+++ io.c	(revision 38401)
@@ -3858,7 +3858,10 @@ finish_writeconv(rb_io_t *fptr, int noal https://github.com/ruby/ruby/blob/trunk/io.c#L3858
             res = rb_econv_convert(fptr->writeconv, NULL, NULL, &dp, de, 0);
             while (dp-ds) {
               retry:
-                r = rb_write_internal(fptr->fd, ds, dp-ds);
+		if (fptr->write_lock && rb_mutex_owned_p(fptr->write_lock))
+		    r = rb_write_internal2(fptr->fd, ds, dp-ds);
+		else
+		    r = rb_write_internal(fptr->fd, ds, dp-ds);
                 if (r == dp-ds)
                     break;
                 if (0 <= r) {

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]