From 0718f53bca25499fdce5af023c9177664a68be7a Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 4 Feb 2018 01:31:48 +0000 Subject: thread.c: timespec_for is used only if poll() is used git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62186 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- thread.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/thread.c b/thread.c index 1f699f6bda..cc8f5a8dac 100644 --- a/thread.c +++ b/thread.c @@ -200,6 +200,16 @@ vm_living_thread_num(rb_vm_t *vm) 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 struct timeval *tv) } return 0; } +#endif #if THREAD_DEBUG #ifdef HAVE_VA_ARGS_MACRO @@ -3879,15 +3890,6 @@ rb_thread_fd_select(int max, rb_fdset_t * read, rb_fdset_t * write, rb_fdset_t * 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. */ -- cgit v1.2.3