From 4ae1fd7492191e01dae3713dae29c4b73c87c76a Mon Sep 17 00:00:00 2001 From: Charles Oliver Nutter Date: Mon, 23 Oct 2023 09:10:58 -0500 Subject: [PATCH] Fiber ext was moved into core in 3.0 --- core/src/main/java/org/jruby/Ruby.java | 1 + .../main/java/org/jruby/ext/fiber/ThreadFiber.java | 6 +++--- lib/ruby/stdlib/fiber.rb | 12 ------------ 3 files changed, 4 insertions(+), 15 deletions(-) delete mode 100644 lib/ruby/stdlib/fiber.rb diff --git a/core/src/main/java/org/jruby/Ruby.java b/core/src/main/java/org/jruby/Ruby.java index 03dbc4da8dcb..f24ecba7807e 100644 --- a/core/src/main/java/org/jruby/Ruby.java +++ b/core/src/main/java/org/jruby/Ruby.java @@ -591,6 +591,7 @@ private void initBootLibraries() { loadService.provide("rational.rb"); loadService.provide("complex.rb"); loadService.provide("thread.rb"); + loadService.provide("fiber.rb"); loadService.provide("ruby2_keywords.rb"); // Load preludes diff --git a/core/src/main/java/org/jruby/ext/fiber/ThreadFiber.java b/core/src/main/java/org/jruby/ext/fiber/ThreadFiber.java index f29be1be42a0..45515396e573 100644 --- a/core/src/main/java/org/jruby/ext/fiber/ThreadFiber.java +++ b/core/src/main/java/org/jruby/ext/fiber/ThreadFiber.java @@ -305,7 +305,7 @@ private static void handleExceptionDuringExchange(ThreadContext context, FiberDa } @JRubyMethod(rest = true) - public IRubyObject __transfer__(ThreadContext context, IRubyObject[] values) { + public IRubyObject transfer(ThreadContext context, IRubyObject[] values) { Ruby runtime = context.runtime; final FiberData data = this.data; @@ -456,12 +456,12 @@ private static FiberData verifyCurrentFiber(ThreadContext context, Ruby runtime) } @JRubyMethod - public IRubyObject __alive__(ThreadContext context) { + public IRubyObject alive(ThreadContext context) { return RubyBoolean.newBoolean(context, alive()); } @JRubyMethod(meta = true) - public static IRubyObject __current__(ThreadContext context, IRubyObject recv) { + public static IRubyObject current(ThreadContext context, IRubyObject recv) { return context.getFiber(); } diff --git a/lib/ruby/stdlib/fiber.rb b/lib/ruby/stdlib/fiber.rb deleted file mode 100644 index d568fc8e963e..000000000000 --- a/lib/ruby/stdlib/fiber.rb +++ /dev/null @@ -1,12 +0,0 @@ -## -# Extensions to Fiber. In JRuby, these are all still defined in the normal -# Fiber class, so we alias them to the right names here. -# -class Fiber - class << self - alias current __current__ - end - - alias transfer __transfer__ - alias alive? __alive__ -end \ No newline at end of file