diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-02-04 01:31:48 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-02-04 01:31:48 +0000 |
commit | 0718f53bca25499fdce5af023c9177664a68be7a (patch) | |
tree | b1332f99d979337a97d5856fa71de0f823273d5a /thread.c | |
parent | 05c18139a1545a61caaaf33d888c8427d346b571 (diff) | |
download | ruby-0718f53bca25499fdce5af023c9177664a68be7a.tar.gz |
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
Diffstat (limited to 'thread.c')
-rw-r--r-- | thread.c | 20 |
1 files changed, 11 insertions, 9 deletions
@@ -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. */ |