@@ -669,12 +669,13 @@ static Object call(
669
669
@ Cached TranslateInteropExceptionNode translateInteropExceptionNode ,
670
670
@ Bind ("this" ) Node node ,
671
671
@ 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 ();
673
674
final Interrupter interrupter ;
674
675
if (unblocker == nil ) {
675
676
interrupter = threadManager .getNativeCallInterrupter ();
676
677
} else {
677
- interrupter = makeInterrupter ( getContext ( node ) , unblockWrapper , unblocker , unblockerArg );
678
+ interrupter = new CExtInterrupter ( context , unblockWrapper , unblocker , unblockerArg );
678
679
}
679
680
680
681
final Object [] args = { function , arg };
@@ -687,12 +688,6 @@ static Object call(
687
688
node );
688
689
}
689
690
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
-
696
691
private static final class CExtInterrupter implements Interrupter {
697
692
698
693
private final RubyContext context ;
@@ -721,7 +716,6 @@ public void interrupt(Thread thread) {
721
716
}
722
717
prev = truffleContext .enter (null );
723
718
} catch (IllegalStateException e ) { // Multi threaded access denied from Truffle
724
- // Not in a context, so we cannot use TruffleLogger
725
719
context .getLogger ().severe (
726
720
"could not unblock thread inside blocking call in C extension because " +
727
721
"the context does not allow multithreading (" + e .getMessage () + ")" );
0 commit comments