diff options
author | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-10-19 20:14:41 +0000 |
---|---|---|
committer | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-10-19 20:14:41 +0000 |
commit | 98d0ccc86afb6b8e726966f4ed17cfb4e645d307 (patch) | |
tree | c145797f4ffd0862568dcf46c8e98037ab792941 /process.c | |
parent | 07ae480dc4d27cc28007dc2b470f669d924d1334 (diff) | |
download | ruby-98d0ccc86afb6b8e726966f4ed17cfb4e645d307.tar.gz |
rb_sigwait_sleep: change internal API to use rb_hrtime_t
rb_hrtime_t is a more pleasant type to use and this can make
future changes around sleeping/scheduling easier.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65182 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'process.c')
-rw-r--r-- | process.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -17,6 +17,7 @@ #include "ruby/thread.h" #include "ruby/util.h" #include "vm_core.h" +#include "hrtime.h" #include <stdio.h> #include <errno.h> @@ -931,7 +932,7 @@ void rb_native_mutex_unlock(rb_nativethread_lock_t *); void rb_native_cond_signal(rb_nativethread_cond_t *); void rb_native_cond_wait(rb_nativethread_cond_t *, rb_nativethread_lock_t *); int rb_sigwait_fd_get(const rb_thread_t *); -void rb_sigwait_sleep(const rb_thread_t *, int fd, const struct timespec *); +void rb_sigwait_sleep(const rb_thread_t *, int fd, const rb_hrtime_t *); void rb_sigwait_fd_put(const rb_thread_t *, int fd); void rb_thread_sleep_interruptible(void); @@ -1026,11 +1027,11 @@ waitpid_state_init(struct waitpid_state *w, rb_pid_t pid, int options) w->options = options; } -static const struct timespec * +static const rb_hrtime_t * sigwait_sleep_time(void) { if (SIGCHLD_LOSSY) { - static const struct timespec busy_wait = { 0, 100000000 }; + static const rb_hrtime_t busy_wait = 100 * RB_HRTIME_PER_MSEC; return &busy_wait; } |