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

ruby-changes:24894

From: usa <ko1@a...>
Date: Mon, 10 Sep 2012 10:42:11 +0900 (JST)
Subject: [ruby-changes:24894] usa:r36946 (trunk): * ext/socket/{basicksocket,init,udpsocket}.c: revert some parts of

usa	2012-09-10 10:41:59 +0900 (Mon, 10 Sep 2012)

  New Revision: 36946

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

  Log:
    * ext/socket/{basicksocket,init,udpsocket}.c: revert some parts of
      r36944.  it breaks mswin/mingw ruby and brought into many many
      crashes.

  Modified files:
    trunk/ext/socket/basicsocket.c
    trunk/ext/socket/init.c
    trunk/ext/socket/udpsocket.c

Index: ext/socket/udpsocket.c
===================================================================
--- ext/socket/udpsocket.c	(revision 36945)
+++ ext/socket/udpsocket.c	(revision 36946)
@@ -176,6 +176,7 @@
       retry:
 	arg.to = res->ai_addr;
 	arg.tolen = res->ai_addrlen;
+	rb_thread_fd_writable(arg.fd);
 	n = (int)BLOCKING_REGION_FD(rsock_sendto_blocking, &arg);
 	if (n >= 0) {
 	    freeaddrinfo(res0);
Index: ext/socket/init.c
===================================================================
--- ext/socket/init.c	(revision 36945)
+++ ext/socket/init.c	(revision 36946)
@@ -130,6 +130,7 @@
     RBASIC(str)->klass = 0;
 
     while (rb_io_check_closed(fptr),
+	   rb_thread_wait_fd(arg.fd),
 	   (slen = BLOCKING_REGION_FD(recvfrom_blocking, &arg)) < 0) {
         if (!rb_io_wait_readable(fptr->fd)) {
             rb_sys_fail("recvfrom(2)");
@@ -559,6 +560,7 @@
     arg.sockaddr = sockaddr;
     arg.len = len;
   retry:
+    rb_thread_wait_fd(fd);
     fd2 = (int)BLOCKING_REGION_FD(accept_blocking, &arg);
     if (fd2 < 0) {
 	switch (errno) {
Index: ext/socket/basicsocket.c
===================================================================
--- ext/socket/basicsocket.c	(revision 36945)
+++ ext/socket/basicsocket.c	(revision 36946)
@@ -558,7 +558,8 @@
     GetOpenFile(sock, fptr);
     arg.fd = fptr->fd;
     arg.flags = NUM2INT(flags);
-    while ((n = (int)BLOCKING_REGION_FD(func, &arg)) < 0) {
+    while (rb_thread_fd_writable(arg.fd),
+	   (n = (int)BLOCKING_REGION_FD(func, &arg)) < 0) {
 	if (rb_io_wait_writable(arg.fd)) {
 	    continue;
 	}

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

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