diff options
author | Samuel Williams <[email protected]> | 2021-02-09 19:39:56 +1300 |
---|---|---|
committer | GitHub <[email protected]> | 2021-02-09 19:39:56 +1300 |
commit | 5f69a7f60467fa58c2f998daffab43e118bff36c (patch) | |
tree | f60e3a5add29eb9cc7e68433c4e373e2a2facab7 /eval.c | |
parent | 3c593f28ede99b77d4fe3258f9bda78dcee238a3 (diff) |
Expose scheduler as public interface & bug fixes. (#3945)
* Rename `rb_scheduler` to `rb_fiber_scheduler`.
* Use public interface if available.
* Use `rb_check_funcall` where possible.
* Don't use `unblock` unless the fiber was non-blocking.
Notes
Notes:
Merged-By: ioquatix <[email protected]>
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -29,7 +29,7 @@ #include "internal/object.h" #include "internal/thread.h" #include "internal/variable.h" -#include "internal/scheduler.h" +#include "ruby/fiber/scheduler.h" #include "iseq.h" #include "mjit.h" #include "probes.h" @@ -147,13 +147,13 @@ ruby_options(int argc, char **argv) } static void -rb_ec_scheduler_finalize(rb_execution_context_t *ec) +rb_ec_fiber_scheduler_finalize(rb_execution_context_t *ec) { enum ruby_tag_type state; EC_PUSH_TAG(ec); if ((state = EC_EXEC_TAG()) == TAG_NONE) { - rb_scheduler_set(Qnil); + rb_fiber_scheduler_set(Qnil); } else { state = error_handle(ec, state); @@ -165,7 +165,7 @@ static void rb_ec_teardown(rb_execution_context_t *ec) { // If the user code defined a scheduler for the top level thread, run it: - rb_ec_scheduler_finalize(ec); + rb_ec_fiber_scheduler_finalize(ec); EC_PUSH_TAG(ec); if (EC_EXEC_TAG() == TAG_NONE) { |