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

ruby-changes:9779

From: yugui <ko1@a...>
Date: Sun, 4 Jan 2009 23:05:39 +0900 (JST)
Subject: [ruby-changes:9779] Ruby:r21320 (ruby_1_9_1): merges r21288 from trunk into ruby_1_9_1.

yugui	2009-01-04 23:05:19 +0900 (Sun, 04 Jan 2009)

  New Revision: 21320

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

  Log:
    merges r21288 from trunk into ruby_1_9_1.
    * io.c (maygvl_copy_stream_wait_read): renamed to add prefix to
      express GVL state.
      (nogvl_copy_stream_wait_write): ditto.
      (nogvl_copy_stream_sendfile): ditto.
      (maygvl_copy_stream_read): ditto.
      (nogvl_copy_stream_write): ditto.
      (nogvl_copy_stream_read_write): ditto.
      (nogvl_copy_stream_func): ditto.

  Modified files:
    branches/ruby_1_9_1/ChangeLog
    branches/ruby_1_9_1/io.c

Index: ruby_1_9_1/ChangeLog
===================================================================
--- ruby_1_9_1/ChangeLog	(revision 21319)
+++ ruby_1_9_1/ChangeLog	(revision 21320)
@@ -1,3 +1,14 @@
+Sun Jan  4 03:30:18 2009  Tanaka Akira  <akr@f...>
+
+	* io.c (maygvl_copy_stream_wait_read): renamed to add prefix to
+	  express GVL state.
+	  (nogvl_copy_stream_wait_write): ditto.
+	  (nogvl_copy_stream_sendfile): ditto.
+	  (maygvl_copy_stream_read): ditto.
+	  (nogvl_copy_stream_write): ditto.
+	  (nogvl_copy_stream_read_write): ditto.
+	  (nogvl_copy_stream_func): ditto.
+
 Sun Jan  4 00:30:50 2009  Masatoshi SEKI  <m_seki@m...>
 
 	* lib/erb.rb: merged r20850, r17881, r16811, r16763, r16748, r15829, 
Index: ruby_1_9_1/io.c
===================================================================
--- ruby_1_9_1/io.c	(revision 21319)
+++ ruby_1_9_1/io.c	(revision 21320)
@@ -7296,7 +7296,7 @@
 };
 
 static int
-copy_stream_wait_read(struct copy_stream_struct *stp)
+maygvl_copy_stream_wait_read(struct copy_stream_struct *stp)
 {
     int ret;
     rb_fd_zero(&stp->fds);
@@ -7311,7 +7311,7 @@
 }
 
 static int
-copy_stream_wait_write(struct copy_stream_struct *stp)
+nogvl_copy_stream_wait_write(struct copy_stream_struct *stp)
 {
     int ret;
     rb_fd_zero(&stp->fds);
@@ -7346,7 +7346,7 @@
 
 #ifdef USE_SENDFILE
 static int
-copy_stream_sendfile(struct copy_stream_struct *stp)
+nogvl_copy_stream_sendfile(struct copy_stream_struct *stp)
 {
     struct stat src_stat, dst_stat;
     ssize_t ss;
@@ -7418,7 +7418,7 @@
 #if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
 	  case EWOULDBLOCK:
 #endif
-            if (copy_stream_wait_write(stp) == -1)
+            if (nogvl_copy_stream_wait_write(stp) == -1)
                 return -1;
             if (rb_thread_interrupted(stp->th))
                 return -1;
@@ -7433,7 +7433,7 @@
 #endif
 
 static ssize_t
-copy_stream_read(struct copy_stream_struct *stp, char *buf, int len, off_t offset)
+maygvl_copy_stream_read(struct copy_stream_struct *stp, char *buf, int len, off_t offset)
 {
     ssize_t ss;
   retry_read:
@@ -7456,7 +7456,7 @@
 #if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
 	  case EWOULDBLOCK:
 #endif
-            if (copy_stream_wait_read(stp) == -1)
+            if (maygvl_copy_stream_wait_read(stp) == -1)
                 return -1;
             goto retry_read;
 #ifdef ENOSYS
@@ -7473,7 +7473,7 @@
 }
 
 static int
-copy_stream_write(struct copy_stream_struct *stp, char *buf, int len)
+nogvl_copy_stream_write(struct copy_stream_struct *stp, char *buf, int len)
 {
     ssize_t ss;
     int off = 0;
@@ -7481,7 +7481,7 @@
         ss = write(stp->dst_fd, buf+off, len);
         if (ss == -1) {
             if (errno == EAGAIN || errno == EWOULDBLOCK) {
-                if (copy_stream_wait_write(stp) == -1)
+                if (nogvl_copy_stream_wait_write(stp) == -1)
                     return -1;
                 continue;
             }
@@ -7497,7 +7497,7 @@
 }
 
 static void
-copy_stream_read_write(struct copy_stream_struct *stp)
+nogvl_copy_stream_read_write(struct copy_stream_struct *stp)
 {
     char buf[1024*16];
     int len;
@@ -7533,17 +7533,17 @@
             len = sizeof(buf);
         }
         if (use_pread) {
-            ss = copy_stream_read(stp, buf, len, src_offset);
+            ss = maygvl_copy_stream_read(stp, buf, len, src_offset);
             if (0 < ss)
                 src_offset += ss;
         }
         else {
-            ss = copy_stream_read(stp, buf, len, (off_t)-1);
+            ss = maygvl_copy_stream_read(stp, buf, len, (off_t)-1);
         }
         if (ss <= 0) /* EOF or error */
             return;
 
-        ret = copy_stream_write(stp, buf, ss);
+        ret = nogvl_copy_stream_write(stp, buf, ss);
         if (ret < 0)
             return;
 
@@ -7556,7 +7556,7 @@
 }
 
 static VALUE
-copy_stream_func(void *arg)
+nogvl_copy_stream_func(void *arg)
 {
     struct copy_stream_struct *stp = (struct copy_stream_struct *)arg;
 #ifdef USE_SENDFILE
@@ -7564,12 +7564,12 @@
 #endif
 
 #ifdef USE_SENDFILE
-    ret = copy_stream_sendfile(stp);
+    ret = nogvl_copy_stream_sendfile(stp);
     if (ret != 0)
         goto finish; /* error or success */
 #endif
 
-    copy_stream_read_write(stp);
+    nogvl_copy_stream_read_write(stp);
 
 #ifdef USE_SENDFILE
   finish:
@@ -7612,7 +7612,7 @@
             ssize_t ss;
             rb_thread_wait_fd(stp->src_fd);
             rb_str_resize(buf, buflen);
-            ss = copy_stream_read(stp, RSTRING_PTR(buf), l, off);
+            ss = maygvl_copy_stream_read(stp, RSTRING_PTR(buf), l, off);
             if (ss == -1)
                 return Qnil;
             if (ss == 0)
@@ -7751,7 +7751,7 @@
     rb_fd_set(src_fd, &stp->fds);
     rb_fd_set(dst_fd, &stp->fds);
 
-    return rb_thread_blocking_region(copy_stream_func, (void*)stp, RUBY_UBF_IO, 0);
+    return rb_thread_blocking_region(nogvl_copy_stream_func, (void*)stp, RUBY_UBF_IO, 0);
 }
 
 static VALUE

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

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