Skip to content

Commit dd46ed9

Browse files
committed
Cleanup
1 parent 8b4a7b3 commit dd46ed9

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

spec/ruby/optional/capi/ext/thread_spec.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ static VALUE thread_spec_rb_thread_call_without_gvl(VALUE self) {
6969
}
7070

7171
/* This is unblocked by a signal. */
72-
static void* blocking_gvl_func_for_udf_io(void *data) {
72+
static void* blocking_gvl_func_for_ubf_io(void *data) {
7373
int rfd = (int)(size_t)data;
7474
char dummy;
7575

@@ -89,7 +89,7 @@ static VALUE thread_spec_rb_thread_call_without_gvl_with_ubf_io(VALUE self) {
8989
rb_raise(rb_eRuntimeError, "could not create pipe");
9090
}
9191

92-
ret = rb_thread_call_without_gvl(blocking_gvl_func_for_udf_io,
92+
ret = rb_thread_call_without_gvl(blocking_gvl_func_for_ubf_io,
9393
(void*)(size_t)fds[0], RUBY_UBF_IO, 0);
9494
close(fds[0]);
9595
close(fds[1]);

src/main/java/org/truffleruby/core/thread/ThreadNodes.java

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -669,12 +669,13 @@ static Object call(
669669
@Cached TranslateInteropExceptionNode translateInteropExceptionNode,
670670
@Bind("this") Node node,
671671
@Cached("new(node, receivers, translateInteropExceptionNode)") BlockingCallInterruptible blockingCallInterruptible) {
672-
final ThreadManager threadManager = getContext(node).getThreadManager();
672+
var context = getContext(node);
673+
final ThreadManager threadManager = context.getThreadManager();
673674
final Interrupter interrupter;
674675
if (unblocker == nil) {
675676
interrupter = threadManager.getNativeCallInterrupter();
676677
} else {
677-
interrupter = makeInterrupter(getContext(node), unblockWrapper, unblocker, unblockerArg);
678+
interrupter = new CExtInterrupter(context, unblockWrapper, unblocker, unblockerArg);
678679
}
679680

680681
final Object[] args = { function, arg };
@@ -687,12 +688,6 @@ static Object call(
687688
node);
688689
}
689690

690-
@TruffleBoundary
691-
private static Interrupter makeInterrupter(RubyContext context, Object wrapper, Object function,
692-
Object argument) {
693-
return new CExtInterrupter(context, wrapper, function, argument);
694-
}
695-
696691
private static final class CExtInterrupter implements Interrupter {
697692

698693
private final RubyContext context;
@@ -721,7 +716,6 @@ public void interrupt(Thread thread) {
721716
}
722717
prev = truffleContext.enter(null);
723718
} catch (IllegalStateException e) { // Multi threaded access denied from Truffle
724-
// Not in a context, so we cannot use TruffleLogger
725719
context.getLogger().severe(
726720
"could not unblock thread inside blocking call in C extension because " +
727721
"the context does not allow multithreading (" + e.getMessage() + ")");

0 commit comments

Comments
 (0)