summaryrefslogtreecommitdiff
path: root/internal/scheduler.h
diff options
context:
space:
mode:
authorSamuel Williams <samuel.williams@oriontransfer.co.nz>2020-08-20 13:51:45 +1200
committerSamuel Williams <samuel.williams@oriontransfer.co.nz>2020-09-14 16:44:09 +1200
commitd387029f39d976565c955377117103499d47ff09 (patch)
tree0a28459f929867c698d243584bc676c4ddad100c /internal/scheduler.h
parent905e9c8093b2bb06def609975929465be0f41a0c (diff)
Standardised scheduler interface.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3434
Diffstat (limited to 'internal/scheduler.h')
-rw-r--r--internal/scheduler.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/internal/scheduler.h b/internal/scheduler.h
new file mode 100644
index 00000000000..be976d7be56
--- /dev/null
+++ b/internal/scheduler.h
@@ -0,0 +1,27 @@
+#ifndef RUBY_SCHEDULER_H /*-*-C-*-vi:se ft=c:*/
+#define RUBY_SCHEDULER_H
+/**
+ * @file
+ * @author Ruby developers <ruby-core@ruby-lang.org>
+ * @copyright This file is a part of the programming language Ruby.
+ * Permission is hereby granted, to either redistribute and/or
+ * modify this file, provided that the conditions mentioned in the
+ * file COPYING are met. Consult the file for details.
+ * @brief Internal header for Scheduler.
+ */
+#include "ruby/ruby.h"
+#include "ruby/intern.h"
+
+VALUE rb_scheduler_timeout(struct timeval *timeout);
+
+VALUE rb_scheduler_kernel_sleep(VALUE scheduler, VALUE duration);
+VALUE rb_scheduler_kernel_sleepv(VALUE scheduler, int argc, VALUE * argv);
+
+VALUE rb_scheduler_io_wait(VALUE scheduler, VALUE io, VALUE events, VALUE timeout);
+VALUE rb_scheduler_io_wait_readable(VALUE scheduler, VALUE io);
+VALUE rb_scheduler_io_wait_writable(VALUE scheduler, VALUE io);
+
+VALUE rb_scheduler_io_read(VALUE scheduler, VALUE io, VALUE buffer, VALUE offset, VALUE length);
+VALUE rb_scheduler_io_write(VALUE scheduler, VALUE io, VALUE buffer, VALUE offset, VALUE length);
+
+#endif /* RUBY_SCHEDULER_H */