diff options
author | Benoit Daloze <eregontp@gmail.com> | 2020-09-17 14:30:40 +0200 |
---|---|---|
committer | Benoit Daloze <eregontp@gmail.com> | 2020-09-17 14:30:40 +0200 |
commit | 738a089b3ac55e5bfb26f9121ee73ffcb8c4a36b (patch) | |
tree | 0fb3bb95dc74207648344e98600a43d3e67b98ae /scheduler.c | |
parent | c3acfcc78da84002b7dd5000bad21663f0773e2a (diff) |
Rename scheduler.{mutex_lock,mutex_unlock} to {block,unblock}
* Move #kernel_sleep next to #block as it is similar
Diffstat (limited to 'scheduler.c')
-rw-r--r-- | scheduler.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/scheduler.c b/scheduler.c index 9ecc40cf6c..f038eed9ef 100644 --- a/scheduler.c +++ b/scheduler.c @@ -12,8 +12,8 @@ #include "ruby/io.h" static ID id_kernel_sleep; -static ID id_mutex_lock; -static ID id_mutex_unlock; +static ID id_block; +static ID id_unblock; static ID id_io_read; static ID id_io_write; static ID id_io_wait; @@ -22,8 +22,8 @@ void Init_Scheduler(void) { id_kernel_sleep = rb_intern_const("kernel_sleep"); - id_mutex_lock = rb_intern_const("mutex_lock"); - id_mutex_unlock = rb_intern_const("mutex_unlock"); + id_block = rb_intern_const("block"); + id_unblock = rb_intern_const("unblock"); id_io_read = rb_intern_const("io_read"); id_io_write = rb_intern_const("io_write"); id_io_wait = rb_intern_const("io_wait"); @@ -48,14 +48,14 @@ VALUE rb_scheduler_kernel_sleepv(VALUE scheduler, int argc, VALUE * argv) return rb_funcallv(scheduler, id_kernel_sleep, argc, argv); } -VALUE rb_scheduler_mutex_lock(VALUE scheduler, VALUE mutex) +VALUE rb_scheduler_block(VALUE scheduler, VALUE blocker) { - return rb_funcall(scheduler, id_mutex_lock, 1, mutex); + return rb_funcall(scheduler, id_block, 1, blocker); } -VALUE rb_scheduler_mutex_unlock(VALUE scheduler, VALUE mutex, VALUE fiber) +VALUE rb_scheduler_unblock(VALUE scheduler, VALUE blocker, VALUE fiber) { - return rb_funcall(scheduler, id_mutex_unlock, 2, mutex, fiber); + return rb_funcall(scheduler, id_unblock, 2, blocker, fiber); } VALUE rb_scheduler_io_wait(VALUE scheduler, VALUE io, VALUE events, VALUE timeout) |