summaryrefslogtreecommitdiff
path: root/process.c
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-19 20:14:41 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-19 20:14:41 +0000
commit98d0ccc86afb6b8e726966f4ed17cfb4e645d307 (patch)
treec145797f4ffd0862568dcf46c8e98037ab792941 /process.c
parent07ae480dc4d27cc28007dc2b470f669d924d1334 (diff)
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.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/process.c b/process.c
index 987fccdea7..4448f26c7b 100644
--- a/process.c
+++ b/process.c
@@ -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;
}