Skip to content

Commit 76990cd

Browse files
committed
[Truffle] Fix spec failure.
* Fiber also receive ThreadExitException with the current scheme.
1 parent 6d7368c commit 76990cd

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

truffle/src/main/java/org/jruby/truffle/runtime/core/RubyFiber.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@
1010
package org.jruby.truffle.runtime.core;
1111

1212
import com.oracle.truffle.api.nodes.ControlFlowException;
13-
1413
import com.oracle.truffle.api.nodes.Node;
14+
1515
import org.jruby.truffle.nodes.RubyNode;
1616
import org.jruby.truffle.nodes.objects.Allocator;
1717
import org.jruby.truffle.runtime.RubyContext;
1818
import org.jruby.truffle.runtime.control.BreakException;
1919
import org.jruby.truffle.runtime.control.RaiseException;
2020
import org.jruby.truffle.runtime.control.ReturnException;
21+
import org.jruby.truffle.runtime.control.ThreadExitException;
2122
import org.jruby.truffle.runtime.subsystems.FiberManager;
2223
import org.jruby.truffle.runtime.subsystems.ThreadManager;
2324
import org.jruby.truffle.runtime.subsystems.ThreadManager.BlockingActionWithoutGlobalLock;
@@ -123,7 +124,7 @@ public void run() {
123124
final Object[] args = finalFiber.waitForResume();
124125
final Object result = finalBlock.rootCall(args);
125126
finalFiber.resume(finalFiber.lastResumedByFiber, true, result);
126-
} catch (FiberExitException e) {
127+
} catch (FiberExitException | ThreadExitException e) { // TODO (eregon, 21 Apr. 2015): The thread should cleanly kill its fibers when dying.
127128
// Naturally exit the thread on catching this
128129
} catch (ReturnException e) {
129130
sendMessageTo(finalFiber.lastResumedByFiber, new FiberExceptionMessage(finalFiber.getContext().getCoreLibrary().unexpectedReturn(null)));

truffle/src/main/java/org/jruby/truffle/runtime/subsystems/FiberManager.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
public class FiberManager {
2323

2424
private final RubyFiber rootFiber;
25+
// FIXME (eregon): per ruby thread
2526
private RubyFiber currentFiber;
2627

2728
private final Set<RubyFiber> runningFibers = Collections.newSetFromMap(new ConcurrentHashMap<RubyFiber, Boolean>());

0 commit comments

Comments
 (0)