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

ruby-changes:50068

From: nobu <ko1@a...>
Date: Sun, 4 Feb 2018 10:31:53 +0900 (JST)
Subject: [ruby-changes:50068] nobu:r62186 (trunk): thread.c: timespec_for is used only if poll() is used

nobu	2018-02-04 10:31:48 +0900 (Sun, 04 Feb 2018)

  New Revision: 62186

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=62186

  Log:
    thread.c: timespec_for is used only if poll() is used

  Modified files:
    trunk/thread.c
Index: thread.c
===================================================================
--- thread.c	(revision 62185)
+++ thread.c	(revision 62186)
@@ -200,6 +200,16 @@ vm_living_thread_num(rb_vm_t *vm) https://github.com/ruby/ruby/blob/trunk/thread.c#L200
     return vm->living_thread_num;
 }
 
+/*
+ * poll() is supported by many OSes, but so far Linux is the only
+ * one we know of that supports using poll() in all places select()
+ * would work.
+ */
+#if defined(HAVE_POLL) && defined(__linux__)
+#  define USE_POLL
+#endif
+
+#ifdef USE_POLL
 static inline struct timespec *
 timespec_for(struct timespec *ts, const struct timeval *tv)
 {
@@ -210,6 +220,7 @@ timespec_for(struct timespec *ts, const https://github.com/ruby/ruby/blob/trunk/thread.c#L220
     }
     return 0;
 }
+#endif
 
 #if THREAD_DEBUG
 #ifdef HAVE_VA_ARGS_MACRO
@@ -3879,15 +3890,6 @@ rb_thread_fd_select(int max, rb_fdset_t https://github.com/ruby/ruby/blob/trunk/thread.c#L3890
     return do_select(max, read, write, except, timeout);
 }
 
-/*
- * poll() is supported by many OSes, but so far Linux is the only
- * one we know of that supports using poll() in all places select()
- * would work.
- */
-#if defined(HAVE_POLL) && defined(__linux__)
-#  define USE_POLL
-#endif
-
 #ifdef USE_POLL
 
 /* The same with linux kernel. TODO: make platform independent definition. */

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

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